diff --git a/include/jwt-cpp/jwt.h b/include/jwt-cpp/jwt.h index 82504a7..7e8a921 100644 --- a/include/jwt-cpp/jwt.h +++ b/include/jwt-cpp/jwt.h @@ -803,6 +803,15 @@ namespace jwt { return val; } + /** + * Parse input stream into wrapped json object + * \return input stream + */ + inline std::istream& operator>>(std::istream& is) + { + return is >> val; + } + /** * Get type of contained object * \return Type @@ -1588,3 +1597,14 @@ namespace jwt { return decoded_jwt(token); } } + + +inline std::istream& operator>>(std::istream& is, jwt::claim c) +{ + return c.operator>>(is); +} + +inline std::ostream& operator<<(std::ostream& os, jwt::claim c) +{ + return os << c.to_json(); +}