mirror of
https://github.com/nlohmann/json.git
synced 2026-05-27 00:25:23 +00:00
renamed "toString()" to "to_string()"
This commit is contained in:
+3
-3
@@ -477,7 +477,7 @@ json::operator object_t() const
|
||||
return get<object_t>();
|
||||
}
|
||||
|
||||
const std::string json::toString() const noexcept
|
||||
const std::string json::to_string() const noexcept
|
||||
{
|
||||
switch (_type)
|
||||
{
|
||||
@@ -511,7 +511,7 @@ const std::string json::toString() const noexcept
|
||||
{
|
||||
result += ", ";
|
||||
}
|
||||
result += i->toString();
|
||||
result += i->to_string();
|
||||
}
|
||||
|
||||
return "[" + result + "]";
|
||||
@@ -527,7 +527,7 @@ const std::string json::toString() const noexcept
|
||||
{
|
||||
result += ", ";
|
||||
}
|
||||
result += "\"" + i->first + "\": " + i->second.toString();
|
||||
result += "\"" + i->first + "\": " + i->second.to_string();
|
||||
}
|
||||
|
||||
return "{" + result + "}";
|
||||
|
||||
+3
-3
@@ -181,13 +181,13 @@ class json
|
||||
/// write to stream
|
||||
friend std::ostream& operator<<(std::ostream& o, const json& j)
|
||||
{
|
||||
o << j.toString();
|
||||
o << j.to_string();
|
||||
return o;
|
||||
}
|
||||
/// write to stream
|
||||
friend std::ostream& operator>>(const json& j, std::ostream& o)
|
||||
{
|
||||
o << j.toString();
|
||||
o << j.to_string();
|
||||
return o;
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ class json
|
||||
}
|
||||
|
||||
/// explicit conversion to string representation (C++ style)
|
||||
const std::string toString() const noexcept;
|
||||
const std::string to_string() const noexcept;
|
||||
|
||||
/// add an object/array to an array
|
||||
json& operator+=(const json&);
|
||||
|
||||
Reference in New Issue
Block a user