Add operator<< for json_pointer
This commit is contained in:
parent
e91686cc17
commit
e5f3eb2d7d
@ -12,6 +12,9 @@
|
|||||||
#include <cctype> // isdigit
|
#include <cctype> // isdigit
|
||||||
#include <cerrno> // errno, ERANGE
|
#include <cerrno> // errno, ERANGE
|
||||||
#include <cstdlib> // strtoull
|
#include <cstdlib> // strtoull
|
||||||
|
#ifndef JSON_NO_IO
|
||||||
|
#include <iosfwd> // ostream
|
||||||
|
#endif // JSON_NO_IO
|
||||||
#include <limits> // max
|
#include <limits> // max
|
||||||
#include <numeric> // accumulate
|
#include <numeric> // accumulate
|
||||||
#include <string> // string
|
#include <string> // string
|
||||||
@ -80,6 +83,16 @@ class json_pointer
|
|||||||
return to_string();
|
return to_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef JSON_NO_IO
|
||||||
|
/// @brief write string representation of the JSON pointer to stream
|
||||||
|
/// @sa https://json.nlohmann.me/api/basic_json/operator_ltlt/
|
||||||
|
friend std::ostream& operator<<(std::ostream& o, const json_pointer& ptr)
|
||||||
|
{
|
||||||
|
o << ptr.to_string();
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/// @brief append another JSON pointer at the end of this JSON pointer
|
/// @brief append another JSON pointer at the end of this JSON pointer
|
||||||
/// @sa https://json.nlohmann.me/api/json_pointer/operator_slasheq/
|
/// @sa https://json.nlohmann.me/api/json_pointer/operator_slasheq/
|
||||||
json_pointer& operator/=(const json_pointer& ptr)
|
json_pointer& operator/=(const json_pointer& ptr)
|
||||||
|
|||||||
@ -13455,6 +13455,9 @@ class json_reverse_iterator : public std::reverse_iterator<Base>
|
|||||||
#include <cctype> // isdigit
|
#include <cctype> // isdigit
|
||||||
#include <cerrno> // errno, ERANGE
|
#include <cerrno> // errno, ERANGE
|
||||||
#include <cstdlib> // strtoull
|
#include <cstdlib> // strtoull
|
||||||
|
#ifndef JSON_NO_IO
|
||||||
|
#include <iosfwd> // ostream
|
||||||
|
#endif // JSON_NO_IO
|
||||||
#include <limits> // max
|
#include <limits> // max
|
||||||
#include <numeric> // accumulate
|
#include <numeric> // accumulate
|
||||||
#include <string> // string
|
#include <string> // string
|
||||||
@ -13528,6 +13531,16 @@ class json_pointer
|
|||||||
return to_string();
|
return to_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef JSON_NO_IO
|
||||||
|
/// @brief write string representation of the JSON pointer to stream
|
||||||
|
/// @sa https://json.nlohmann.me/api/basic_json/operator_ltlt/
|
||||||
|
friend std::ostream& operator<<(std::ostream& o, const json_pointer& ptr)
|
||||||
|
{
|
||||||
|
o << ptr.to_string();
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/// @brief append another JSON pointer at the end of this JSON pointer
|
/// @brief append another JSON pointer at the end of this JSON pointer
|
||||||
/// @sa https://json.nlohmann.me/api/json_pointer/operator_slasheq/
|
/// @sa https://json.nlohmann.me/api/json_pointer/operator_slasheq/
|
||||||
json_pointer& operator/=(const json_pointer& ptr)
|
json_pointer& operator/=(const json_pointer& ptr)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user