aboutsummaryrefslogtreecommitdiff
path: root/src/univalue/lib/univalue_write.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2018-09-07 08:22:00 -0400
committerMarcoFalke <falke.marco@gmail.com>2018-09-07 08:21:14 -0400
commitfaad55a9a24601aac47b5e3bc44827ddb41d8f93 (patch)
tree2608058e723256ed51a68b3048af1ae61b03d8ea /src/univalue/lib/univalue_write.cpp
parent4799b0932a10c5a48706700a07899b33ef9c8bae (diff)
parentdc287c98f8b33576f3c71db02a232106ef0e57d9 (diff)
downloadbitcoin-faad55a9a24601aac47b5e3bc44827ddb41d8f93.tar.xz
Update univalue subtree
Diffstat (limited to 'src/univalue/lib/univalue_write.cpp')
-rw-r--r--src/univalue/lib/univalue_write.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/univalue/lib/univalue_write.cpp b/src/univalue/lib/univalue_write.cpp
index cf27835991..827eb9b271 100644
--- a/src/univalue/lib/univalue_write.cpp
+++ b/src/univalue/lib/univalue_write.cpp
@@ -8,11 +8,9 @@
#include "univalue.h"
#include "univalue_escapes.h"
-using namespace std;
-
-static string json_escape(const string& inS)
+static std::string json_escape(const std::string& inS)
{
- string outS;
+ std::string outS;
outS.reserve(inS.size() * 2);
for (unsigned int i = 0; i < inS.size(); i++) {
@@ -28,10 +26,10 @@ static string json_escape(const string& inS)
return outS;
}
-string UniValue::write(unsigned int prettyIndent,
- unsigned int indentLevel) const
+std::string UniValue::write(unsigned int prettyIndent,
+ unsigned int indentLevel) const
{
- string s;
+ std::string s;
s.reserve(1024);
unsigned int modIndent = indentLevel;
@@ -62,12 +60,12 @@ string UniValue::write(unsigned int prettyIndent,
return s;
}
-static void indentStr(unsigned int prettyIndent, unsigned int indentLevel, string& s)
+static void indentStr(unsigned int prettyIndent, unsigned int indentLevel, std::string& s)
{
s.append(prettyIndent * indentLevel, ' ');
}
-void UniValue::writeArray(unsigned int prettyIndent, unsigned int indentLevel, string& s) const
+void UniValue::writeArray(unsigned int prettyIndent, unsigned int indentLevel, std::string& s) const
{
s += "[";
if (prettyIndent)
@@ -89,7 +87,7 @@ void UniValue::writeArray(unsigned int prettyIndent, unsigned int indentLevel, s
s += "]";
}
-void UniValue::writeObject(unsigned int prettyIndent, unsigned int indentLevel, string& s) const
+void UniValue::writeObject(unsigned int prettyIndent, unsigned int indentLevel, std::string& s) const
{
s += "{";
if (prettyIndent)