20#include "mongo/bson/bsonobj.h"
21#include "mongo/base/status.h"
22#include "mongo/client/export_macros.h"
42MONGO_CLIENT_API
BSONObj MONGO_CLIENT_FUNC
fromjson(
const char* str,
int* len = NULL);
320 Status regexPat(std::string* result);
321 Status regexOpt(std::string* result);
346 Status field(std::string* result);
355 Status quotedString(std::string* result);
391 Status chars(std::string* result,
const char* terminalSet,
const char* allowedSet = NULL);
399 std::string encodeUTF8(
unsigned char first,
unsigned char second)
const;
407 inline bool peekToken(
const char* token);
415 inline bool readToken(
const char* token);
423 bool readTokenImpl(
const char* token,
bool advance =
true);
435 bool match(
char matchChar,
const char* matchSet)
const;
455 inline int offset() {
456 return (_input - _buf);
471 const char*
const _buf;
473 const char*
const _input_end;
Utility for creating a BSONObj.
Definition bsonobjbuilder.h:53
C++ representation of a "BSON" object – that is, an extended JSON-style object in a binary representa...
Definition bsonobj.h:78
Parser class.
Definition json.h:88
Status represents an error state or the absence thereof.
Definition status.h:50
A StringData object wraps a 'const string&' or a 'const char*' without copying its contents.
Definition string_data.h:43
Utility functions for parsing numbers from strings.
Definition compare_numbers.h:20
JsonStringFormat
Formatting mode for generating JSON from BSON.
Definition oid.h:205
@ Strict
strict RFC format
Definition oid.h:207
MONGO_CLIENT_API bool isArray(const StringData &str)
Tests whether the JSON string is an Array.
MONGO_CLIENT_API BSONObj MONGO_CLIENT_FUNC fromjson(const std::string &str)
Create a BSONObj from a JSON http://www.json.org, http://www.ietf.org/rfc/rfc4627....
MONGO_CLIENT_API std::string tojson(const BSONArray &arr, JsonStringFormat format=Strict, bool pretty=false)
Convert a BSONArray to a JSON string.