mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
Squashed 'src/univalue/' changes from 51d3ab34ba..7890db99d6
7890db99d6 Merge #11: Remove deprecated std pair wrappers 40e34852ac Merge #14: Cleaned up namespace imports to reduce symbol collisions 85052a4819 Remove deprecated std::pair wrappers d208f986dd Cleaned up namespace imports to reduce symbol collisions git-subtree-dir: src/univalue git-subtree-split: 7890db99d693572d27ade3e14268bd7236134529
This commit is contained in:
parent
a570098021
commit
dc287c98f8
6 changed files with 27 additions and 104 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue