mirror of
https://github.com/boostorg/json.git
synced 2026-02-09 11:12:37 +00:00
move operator<< overloads to corresponding headers
This commit is contained in:
@@ -1659,6 +1659,30 @@ public:
|
||||
return ! (lhs == rhs);
|
||||
}
|
||||
|
||||
/** Serialize @ref array to an output stream.
|
||||
|
||||
This function serializes an `array` as JSON into the output stream.
|
||||
|
||||
@return Reference to `os`.
|
||||
|
||||
@par Complexity
|
||||
Constant or linear in the size of `arr`.
|
||||
|
||||
@par Exception Safety
|
||||
Strong guarantee.
|
||||
Calls to `memory_resource::allocate` may throw.
|
||||
|
||||
@param os The output stream to serialize to.
|
||||
|
||||
@param arr The value to serialize.
|
||||
*/
|
||||
BOOST_JSON_DECL
|
||||
friend
|
||||
std::ostream&
|
||||
operator<<(
|
||||
std::ostream& os,
|
||||
array const& arr);
|
||||
|
||||
private:
|
||||
template<class It>
|
||||
using iter_cat = typename
|
||||
|
||||
@@ -1529,6 +1529,29 @@ public:
|
||||
return ! (lhs == rhs);
|
||||
}
|
||||
|
||||
/** Serialize @ref object to an output stream.
|
||||
|
||||
This function serializes an `object` as JSON into the output stream.
|
||||
|
||||
@return Reference to `os`.
|
||||
|
||||
@par Complexity
|
||||
Constant or linear in the size of `obj`.
|
||||
|
||||
@par Exception Safety
|
||||
Strong guarantee.
|
||||
Calls to `memory_resource::allocate` may throw.
|
||||
|
||||
@param os The output stream to serialize to.
|
||||
|
||||
@param obj The value to serialize.
|
||||
*/
|
||||
BOOST_JSON_DECL
|
||||
friend
|
||||
std::ostream&
|
||||
operator<<(
|
||||
std::ostream& os,
|
||||
object const& obj);
|
||||
private:
|
||||
#ifndef BOOST_JSON_DOCS
|
||||
// VFALCO friending a detail function makes it public
|
||||
|
||||
@@ -55,50 +55,6 @@ std::string
|
||||
serialize(string_view t);
|
||||
/** @} */
|
||||
|
||||
/** Serialize an element to an output stream.
|
||||
|
||||
This function serializes the specified element
|
||||
as JSON into the output stream.
|
||||
|
||||
@return `os`.
|
||||
|
||||
@par Complexity
|
||||
Constant or linear in the size of `t`.
|
||||
|
||||
@par Exception Safety
|
||||
Strong guarantee.
|
||||
Calls to `memory_resource::allocate` may throw.
|
||||
|
||||
@param os The output stream to serialize to.
|
||||
|
||||
@param t The value to serialize
|
||||
*/
|
||||
/** @{ */
|
||||
BOOST_JSON_DECL
|
||||
std::ostream&
|
||||
operator<<(
|
||||
std::ostream& os,
|
||||
value const& t);
|
||||
|
||||
BOOST_JSON_DECL
|
||||
std::ostream&
|
||||
operator<<(
|
||||
std::ostream& os,
|
||||
array const& t);
|
||||
|
||||
BOOST_JSON_DECL
|
||||
std::ostream&
|
||||
operator<<(
|
||||
std::ostream& os,
|
||||
object const& t);
|
||||
|
||||
BOOST_JSON_DECL
|
||||
std::ostream&
|
||||
operator<<(
|
||||
std::ostream& os,
|
||||
string const& t);
|
||||
/** @} */
|
||||
|
||||
BOOST_JSON_NS_END
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2738,6 +2738,30 @@ public:
|
||||
return subview().find_last_not_of(ch, pos);
|
||||
}
|
||||
|
||||
/** Serialize @ref string to an output stream.
|
||||
|
||||
This function serializes a `string` as JSON into the output stream.
|
||||
|
||||
@return Reference to `os`.
|
||||
|
||||
@par Complexity
|
||||
Constant or linear in the size of `str`.
|
||||
|
||||
@par Exception Safety
|
||||
Strong guarantee.
|
||||
Calls to `memory_resource::allocate` may throw.
|
||||
|
||||
@param os The output stream to serialize to.
|
||||
|
||||
@param str The value to serialize.
|
||||
*/
|
||||
BOOST_JSON_DECL
|
||||
friend
|
||||
std::ostream&
|
||||
operator<<(
|
||||
std::ostream& os,
|
||||
string const& str);
|
||||
|
||||
private:
|
||||
class undo;
|
||||
|
||||
|
||||
@@ -3315,6 +3315,30 @@ public:
|
||||
return ! (lhs == rhs);
|
||||
}
|
||||
|
||||
/** Serialize @ref value to an output stream.
|
||||
|
||||
This function serializes a `value` as JSON into the output stream.
|
||||
|
||||
@return Reference to `os`.
|
||||
|
||||
@par Complexity
|
||||
Constant or linear in the size of `jv`.
|
||||
|
||||
@par Exception Safety
|
||||
Strong guarantee.
|
||||
Calls to `memory_resource::allocate` may throw.
|
||||
|
||||
@param os The output stream to serialize to.
|
||||
|
||||
@param jv The value to serialize.
|
||||
*/
|
||||
BOOST_JSON_DECL
|
||||
friend
|
||||
std::ostream&
|
||||
operator<<(
|
||||
std::ostream& os,
|
||||
value const& jv);
|
||||
|
||||
private:
|
||||
static
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user