+ more test cases
This commit is contained in:
parent
5b1f69ce5b
commit
ea94518a64
3 changed files with 71 additions and 4 deletions
|
@ -285,7 +285,7 @@ JSON::~JSON() noexcept
|
|||
@param s a string representation of a JSON object
|
||||
@return a JSON object
|
||||
*/
|
||||
JSON JSON::parse(std::string& s)
|
||||
JSON JSON::parse(const std::string& s)
|
||||
{
|
||||
JSON j;
|
||||
Parser(s).parse(j);
|
||||
|
@ -1892,7 +1892,7 @@ JSON::Parser::Parser(const char* s)
|
|||
/*!
|
||||
@copydoc JSON::Parser::Parser(const char* s)
|
||||
*/
|
||||
JSON::Parser::Parser(std::string& s)
|
||||
JSON::Parser::Parser(const std::string& s)
|
||||
: _length(s.length()), _buffer(new char[_length + 1])
|
||||
{
|
||||
std::strcpy(_buffer, s.c_str());
|
||||
|
|
|
@ -139,7 +139,7 @@ class JSON
|
|||
~JSON() noexcept;
|
||||
|
||||
/// create from string representation
|
||||
static JSON parse(std::string&);
|
||||
static JSON parse(const std::string&);
|
||||
/// create from string representation
|
||||
static JSON parse(const char*);
|
||||
|
||||
|
@ -387,7 +387,7 @@ class JSON
|
|||
/// a parser reading from a C string
|
||||
Parser(const char*);
|
||||
/// a parser reading from a C++ string
|
||||
Parser(std::string&);
|
||||
Parser(const std::string&);
|
||||
/// a parser reading from an input stream
|
||||
Parser(std::istream&);
|
||||
/// destructor of the parser
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue