libvariant library namespace More...
Classes | |
| class | AdvSchemaLoader |
| class | ArgParse |
| An argument parsing class that constructs a Variant from the command line. More... | |
| class | ArgParseOption |
| ArgParseOption is a part of class ArgParse. More... | |
| class | BadPathError |
| Exception thrown from path functions. More... | |
| class | Blob |
| class | BundleHdrEmitterImpl |
| class | BundleHdrParserImpl |
| class | Emitter |
| class | EmitterFilenameOutput |
| class | EmitterFileOutput |
| class | EmitterImpl |
| class | EmitterMemoryOutput |
| class | EmitterOutput |
| class | EmitterParserActions |
| class | EmitterStreambufOutput |
| class | EventBuffer |
| class | InvalidOperationError |
| class | InvalidReferenceError |
| class | JSONEmitterImpl |
| class | JSONParserImpl |
| class | KeyError |
| Exception thrown when a key does not exist. More... | |
| class | LoadAllIterator |
| An iterator that iterates over all documents that the parser will generate. More... | |
| class | MsgPackEmitterImpl |
| class | MsgPackParserImpl |
| class | NotNumericTypeError |
| Exception thrown when attempting a numeric operation on a non numeric type. More... | |
| class | OptionGroup |
| Groups are a way to organize the option and to provide mutual exclusion. More... | |
| class | Parser |
| The public parser interface. More... | |
| class | ParserActions |
| class | ParserFileInput |
| FILE handle parser input. More... | |
| class | ParserFilenameInput |
| Parser input from a filename. More... | |
| class | ParserImpl |
| The class that parser implementations override. More... | |
| class | ParserInput |
| The ParserInput abstract base class. More... | |
| class | ParserMemoryInput |
| A memory parser input. More... | |
| class | ParserStreambufInput |
| Parser input from a streambuf. More... | |
| class | ParserStreamInput |
| A partially specialized parser input adapted to stream based inputs. More... | |
| class | ParserStringInput |
| std::string parser input More... | |
| class | PathElement |
| Basic element of a path. More... | |
| struct | RefTag |
| class | SchemaError |
| Error class to encapsulate an error with the schema. More... | |
| class | SchemaLoader |
| class | SchemaResult |
| Result class of a schema validation. More... | |
| class | TypeNotIndexableError |
| Exception thrown when trying to index a type other than map or list. More... | |
| class | UnableToConvertError |
| Exception thrown when a function cannot convert the Variant to an acceptable type for the routine. More... | |
| class | UnexpectedTypeError |
| Exception thrown when a function expects a specific type but the action type conflicts. More... | |
| class | UnknownTypeError |
| Exception thrown when internal state is corrupt. More... | |
| class | ValidationError |
| This class encapsulates the information from a schema validation error. More... | |
| class | Variant |
| The Variant class. This is a variant type inspired by types from several different scripting languages. More... | |
| struct | VariantCaster |
| struct | VariantCaster< std::complex< T > > |
| struct | VariantCaster< std::map< std::string, T > > |
| struct | VariantCaster< std::vector< T > > |
| class | VariantDefines |
| class | VariantRefImpl |
| class | XMLPLISTEmitterImpl |
| class | XMLPLISTParserImpl |
| class | YAMLEmitterImpl |
| class | YAMLParserImpl |
Typedefs | |
|
typedef std::map< std::string, Variant > | AnchorMap |
| typedef shared_ptr< Blob > | BlobPtr |
| typedef shared_ptr< const Blob > | ConstBlobPtr |
| typedef void(* | BlobFreeFunc )(void *ptr, void *ctx) |
| typedef std::deque< PathElement > | Path |
| typedef VariantRefImpl< Variant > | VariantRef |
Enumerations | |
| enum | Operations_e { OP_ADD, OP_REMOVE, OP_TEST, OP_GET } |
| enum | ArgParseAction { ARGACTION_UNKNOWN, ARGACTION_STORE, ARGACTION_STORE_CONST, ARGACTION_STORE_TRUE, ARGACTION_STORE_FALSE, ARGACTION_APPEND, ARGACTION_COUNT, ARGACTION_HELP, ARGACTION_ADVHELP, ARGACTION_CONFIG, ARGACTION_CONFIG_JSON, ARGACTION_CONFIG_YAML, ARGACTION_CONFIG_PLIST, ARGACTION_PRINT_CONFIG } |
| enum | ArgParseType { ARGTYPE_GUESS = Variant::NullType, ARGTYPE_INT = Variant::IntegerType, ARGTYPE_UINT = Variant::UnsignedType, ARGTYPE_FLOAT = Variant::FloatType, ARGTYPE_STRING = Variant::StringType, ARGTYPE_BOOL = Variant::BoolType } |
| enum | SerializeType { SERIALIZE_GUESS = 0x0, SERIALIZE_JSON = 0x00000001, SERIALIZE_YAML, SERIALIZE_XMLPLIST, SERIALIZE_BUNDLEHDR, SERIALIZE_MSGPACK = 0x000000FF } |
| The different types of serialization supported. | |
Functions | |
| ArgParseAction | ArgParseActionFromStr (const std::string &action) |
| Valid values are: | |
| std::string | ArgParseActionToStr (ArgParseAction action) |
| ArgParseType | ParseType (const Variant &type) |
| std::string | TypeString (Variant::Type_t type) |
| unsigned | Base64Encode (char *outptr, const void *inptr, unsigned len, unsigned cpl=72) |
| Encode the binary blob of len pointed to by inptr. | |
| unsigned | Base64Encode (char *outptr, const struct iovec *iov, unsigned iov_len, unsigned cpl) |
| unsigned | Base64EncodeSize (unsigned len, unsigned cpl) |
| unsigned | Base64Decode (void *outptr, const char *inptr, unsigned len) |
| Decode a base64 encoded string of length len to a binary blob. | |
| unsigned | Base64DecodeSize (unsigned len) |
| shared_ptr< EmitterOutput > | CreateEmitterOutput (void *ptr, unsigned len, unsigned *out_len) |
| shared_ptr< EmitterOutput > | CreateEmitterOutput (const char *filename) |
| shared_ptr< EmitterOutput > | CreateEmitterOutput (FILE *f) |
| shared_ptr< EmitterOutput > | CreateEmitterOutput (std::streambuf *sb) |
| Emitter | CreateEmitter (shared_ptr< EmitterOutput > o, SerializeType type, Variant params) |
| Emitter | JSONEmitter (shared_ptr< EmitterOutput > o, Variant params) |
| Emitter | YAMLEmitter (shared_ptr< EmitterOutput > o, Variant params) |
| Emitter | XMLPLISTEmitter (shared_ptr< EmitterOutput > o, Variant params) |
| Emitter | BundleHdrEmitter (shared_ptr< EmitterOutput > o, Variant params) |
| Emitter | MsgPackEmitter (shared_ptr< EmitterOutput > o, Variant params) |
| EventBuffer::EventType_t | operator| (EventBuffer::EventType_t lhs, EventBuffer::EventType_t rhs) |
| EventBuffer::EventType_t | operator& (EventBuffer::EventType_t lhs, EventBuffer::EventType_t rhs) |
| std::ostream & | operator<< (std::ostream &os, const EventBuffer::Event &e) |
| std::ostream & | operator<< (std::ostream &os, VariantDefines::Type_t type) |
| void | AddStackTrace (std::ostream &os, int level) |
| bool | SimpleList (const Variant &var) |
| Variant | ExtensionParams () |
| Returns a default parameters for use with FlattenPath and ExpandPath functions. | |
| void | ExtensionParams (VariantRef params) |
| Sets any missing Extension parameters to 'params' for use with FlattenPath and ExpandPath functions. | |
| Variant | FlattenPath (const Variant &var, Variant params=ExtensionParams()) |
| Returns a version of 'var' with flat paths based on 'params'. | |
| Variant | ExpandPath (const Variant &var, Variant params=ExtensionParams()) |
| Returns a version of 'var' with expanded paths based on 'params'. | |
| void | FlattenPathTo (VariantRef flat, const Variant &var, Variant params=ExtensionParams(), std::string prefix="") |
| Flattens 'var' paths to 'flat' based on 'params'. | |
| void | ExpandPathTo (VariantRef expand, const Variant &var, Variant params=ExtensionParams()) |
| Expands 'var' paths to 'expand' based on 'params'. More... | |
| map< string, string > | FlattenPathToStrStrMap (const Variant &var, Variant params=ExtensionParams()) |
| Returns a string string map representation of 'var' based on 'params'. | |
| Variant | RDiff (const Variant &base, const Variant &compare) |
| Returns a variant representing elements in 'compare' that differ from 'base' recursively. | |
| void | RDiff (VariantRef diff, const Variant &base, const Variant &compare) |
| Sets elements into 'diff' from 'compare' that differ from 'base' recursively. | |
| void | RUpdate (VariantRef base, const Variant &update) |
| Updates 'base' with entries in 'update' recursively. | |
| std::string | JSONPointerUnescape (const std::string &fragment) |
| VariantRef | JSONPointerOp (const std::string &pointer, VariantRef v, Operation_t &op) |
| void | JSONPointerAdd (const std::string &pointer, VariantRef v, Variant data) |
| Perform an operations on v according to RFC6901 and RFC6902. More... | |
| void | JSONPointerRemove (const std::string &pointer, VariantRef v) |
| Remove the element in v at the spot specified by pointer. | |
| void | JSONPointerReplace (const std::string &pointer, VariantRef v, Variant data) |
| Replace the value at pointer with data, error if the location does not already exist. | |
| void | JSONPointerMove (const std::string &src, const std::string &dst, VariantRef v) |
| Move the value from src to dst (equivalent to get(src), remove(src), add(dst) | |
| void | JSONPointerCopy (const std::string &src, const std::string &dst, VariantRef v) |
| Copy the value from src to dst (equivalent to add(dst, get(src).Copy())) | |
| VariantRef | JSONPointerLookup (const std::string &pointer, VariantRef v) |
| Perform a lookup into v according to RFC6901, return a reference to the value at the location. | |
| std::string | FormJSONPointer (const Path &path) |
| void | JSONPatchUndo (VariantRef v, std::deque< Patch_t > *undo) |
| bool | JSONPatchOp (VariantRef v, const Variant &diff, std::deque< Patch_t > *undo) |
| std::pair< bool, std::string > | JSONPatch (VariantRef v, const Variant &diff) |
| Perform a patch operation on v with the patch as described by diff according to RFC6902. | |
| void | JSONDiffRef (VariantRef src, VariantRef dst, VariantRef diff, Path &path) |
| Variant | JSONDiff (const Variant &src, const Variant &dst) |
| Create a diff suitable to give to JSONPatch to transform src into dst. | |
| SerializeType | GuessFormat (ParserInput *in) |
| void | GuessScalar (const char *value, unsigned length, const char *anchor, const char *tag, ParserImpl *p, ParserActions *action) |
| int | MsgPackPackerWrite (void *data, const char *buf, unsigned int len) |
| shared_ptr< ParserInput > | CreateParserInput (const std::string &str) |
| Create a parser input from a string. | |
| shared_ptr< ParserInput > | CreateParserInput (const char *str) |
| Create a parser input from a null terminated string. | |
| shared_ptr< ParserInput > | CreateParserInput (const void *ptr, unsigned len) |
| Create a parser input from a pointer and length. | |
| shared_ptr< ParserInput > | CreateParserInputFile (const char *filename) |
| Open the file and create a parser input. | |
| shared_ptr< ParserInput > | CreateParserInputFile (FILE *f) |
| Create a parser input from the open FILE handle. | |
| shared_ptr< ParserInput > | CreateParserInputFile (std::streambuf *sb) |
| Parser | CreateParser (shared_ptr< ParserInput > i, SerializeType type) |
| Generic create parser function. | |
| Parser | CreateParserGuess (shared_ptr< ParserInput > i) |
| Examine the input and guess which of the parsers to create and create it. | |
| Parser | JSONParser (shared_ptr< ParserInput > i) |
| Create a JSON Parser. | |
| Parser | YAMLParser (shared_ptr< ParserInput > i) |
| Create a YAML parser. | |
| Parser | XMLPLISTParser (shared_ptr< ParserInput > i) |
| Create a XMLPLIST parser. | |
| Parser | BundleHdrParser (shared_ptr< ParserInput > i) |
| Create a BundleHdr parser. | |
| Parser | MsgPackParser (shared_ptr< ParserInput > i) |
| Create a MsgPack parser. | |
| void | ParsePath (Path &parsed_path, const std::string &path) |
| Parse the path string into PathElement tokens adding it to the Path. | |
| Path | ParsePath (const std::string &path) |
| Parse the path string into PathElement tokens and return a list. | |
| std::string | PathString (const Path &path) |
| Take the set of PathElement tokens and turn it into a path string. | |
| void | PayloadEmit (const Variant &v, Path::iterator len_i, bool on_len_path, Path::iterator data_i, bool on_data_path, PayloadEmitState &state) |
| void | SerializeWithPayload (shared_ptr< EmitterOutput > out, Variant v, SerializeType type, Variant params) |
| Variant | DeserializeWithPayload (shared_ptr< ParserInput > in, SerializeType type, Variant params, bool be_safe) |
| std::string | SerializeWithPayload (Variant v, SerializeType type, Variant params) |
| void | SerializeWithPayload (const std::string &filename, Variant v, SerializeType type, Variant params) |
| void | SerializeWithPayload (FILE *f, Variant v, SerializeType type, Variant params) |
| void | SerializeWithPayload (std::streambuf *sb, Variant v, SerializeType type, Variant params) |
| unsigned | SerializeWithPayload (void *ptr, unsigned len, Variant v, SerializeType type, Variant params) |
| Variant | DeserializeWithPayload (const std::string &str, SerializeType type, Variant params) |
| Variant | DeserializeWithPayload (const void *ptr, unsigned len, SerializeType type, Variant params=Variant::NullType, bool be_safe=true) |
| If the be_safe parameter is false, then it is considered OK. | |
| Variant | DeserializeWithPayloadFile (const char *filename, SerializeType type, Variant params) |
| Variant | DeserializeWithPayloadFile (FILE *f, SerializeType type, Variant params) |
| Variant | DeserializeWithPayloadFile (std::streambuf *sb, SerializeType type, Variant params) |
| void | SchemaValidate (SchemaContext &ctx, Variant schema, Variant data) |
| void | ValidateNot (SchemaContext &ctx, Variant schema, Variant data) |
| void | ValidateOneOf (SchemaContext &ctx, Variant schema, Variant data) |
| void | ValidateAnyOf (SchemaContext &ctx, Variant schema, Variant data) |
| void | ValidateAllOf (SchemaContext &ctx, Variant schema, Variant data) |
| void | ValidateCombinations (SchemaContext &ctx, Variant schema, Variant data) |
| void | ValidateObjectDependenciesHelper (SchemaContext &ctx, const std::string &dep, Variant data) |
| void | ValidateObjectDependencies (SchemaContext &ctx, Variant schema, Variant data) |
| void | ValidateObjectProperties (SchemaContext &ctx, Variant schema, Variant data) |
| void | ValidateObjectRequiredProperties (SchemaContext &ctx, Variant schema, Variant data) |
| void | ValidateObjectMinMaxProperties (SchemaContext &ctx, Variant schema, Variant data) |
| void | ValidateObject (SchemaContext &ctx, Variant schema, Variant data) |
| void | ValidateArrayItems (SchemaContext &ctx, Variant schema, Variant data) |
| void | ValidateArrayUniqueItems (SchemaContext &ctx, Variant schema, Variant data) |
| void | ValidateArrayLength (SchemaContext &ctx, Variant schema, Variant data) |
| void | ValidateArray (SchemaContext &ctx, Variant schema, Variant data) |
| void | ValidateStringFormat (SchemaContext &ctx, Variant schema, Variant data) |
| void | ValidateStringPattern (SchemaContext &ctx, Variant schema, Variant data) |
| void | ValidateStringLength (SchemaContext &ctx, Variant schema, Variant data) |
| void | ValidateString (SchemaContext &ctx, Variant schema, Variant data) |
| void | ValidateMinMax (SchemaContext &ctx, Variant schema, Variant data) |
| void | ValidateMultipleOf (SchemaContext &ctx, Variant schema, Variant data) |
| void | ValidateNumeric (SchemaContext &ctx, Variant schema, Variant data) |
| void | ValidateEnum (SchemaContext &ctx, Variant schema, Variant data) |
| void | ValidateType (SchemaContext &ctx, Variant schema, Variant data) |
| void | ValidateBasic (SchemaContext &ctx, Variant schema, Variant data) |
| SchemaResult | SchemaValidate (Variant schema, Variant data, SchemaLoader *loader) |
| void | AddSchemaDefaultsImpl (Variant schema, VariantRef data, SchemaLoader *loader) |
| void | AddSchemaListDefaultsImpl (VariantRef slist, VariantRef data, SchemaLoader *loader) |
| void | AddSchemaDefaults (Variant schema, VariantRef data, SchemaLoader *loader) |
| void | InsertIndent (std::ostream &os, unsigned indent) |
| SchemaStaticData * | GetSchemaStaticData () |
| std::string | UnescapeURI (const std::string &uri) |
| std::string | RemoveDotSegments (const std::string &input) |
| Emitter & | operator<< (Emitter &e, const Variant &v) |
| Takes a Variant and Emitter and emits the Variant. | |
| std::string | Serialize (Variant v, SerializeType type, Variant params=Variant::NullType) |
| Serialize a Variant to a string using format type. | |
| void | Serialize (const std::string &filename, Variant v, SerializeType type, Variant params=Variant::NullType) |
| Serialize a Variant to a file using format type. | |
| void | Serialize (FILE *f, Variant v, SerializeType type, Variant params=Variant::NullType) |
| Serialize a Variant to a FILE pointer using format type. | |
| void | Serialize (std::streambuf *sb, Variant v, SerializeType type, Variant params=Variant::NullType) |
| Serialize a Variant to a streambuf* (iostrem.rdbuf()) using format type. | |
| unsigned | Serialize (void *ptr, unsigned len, Variant v, SerializeType type, Variant params=Variant::NullType) |
| Serialize a Variant to a memory buffer of length len, using format type. | |
| Variant | ParseVariant (Parser &p) |
| Takes a parser and produces a Variant from it. | |
| Variant | Deserialize (const std::string &str, SerializeType type) |
| Attempt to deserialize a string in format type to a Variant. | |
| Variant | Deserialize (const char *str, SerializeType type) |
| Attempt to deserialize a null terminated string in format type to a Variant. | |
| Variant | Deserialize (const void *ptr, unsigned len, SerializeType type) |
| Attempt to deserialize a pointer and length in format type to a Variant. | |
| Variant | DeserializeFile (const char *filename, SerializeType type) |
| Attempt to deserialize the file to a Variant in format type. | |
| Variant | DeserializeFile (FILE *f, SerializeType type) |
| Deserialize from a FILE pointer to a Variant in format type. | |
| Variant | DeserializeFile (std::streambuf *sb, SerializeType type) |
| Deserialize from a streambuf to a Variant in format type. | |
| Variant | DeserializeGuess (const std::string &str) |
| Variant | DeserializeGuess (const char *str) |
| Variant | DeserializeGuess (const void *ptr, unsigned len) |
| Variant | DeserializeGuessFile (const char *filename) |
| Variant | DeserializeGuessFile (FILE *f) |
| Variant | DeserializeGuessFile (std::streambuf *sb) |
| LoadAllIterator | DeserializeAll (const std::string &str, SerializeType type) |
| LoadAllIterator | DeserializeAll (const char *str, SerializeType type) |
| LoadAllIterator | DeserializeAll (const void *ptr, unsigned len, SerializeType type) |
| LoadAllIterator | DeserializeAllFile (const char *filename, SerializeType type) |
| LoadAllIterator | DeserializeAllFile (FILE *f, SerializeType type) |
| File must remain open for as long as the iterator is referenced. | |
| LoadAllIterator | DeserializeAllFile (std::streambuf *sb, SerializeType type) |
| Streambuf must exist for as long as the iterator is referenced. | |
| void | ParseScalar (yaml_event_t &event, ParserImpl *p, ParserActions *action) |
| template<typename T > | |
| Emitter & | operator<< (Emitter &e, const std::vector< T > &v) |
| template<typename T > | |
| Emitter & | operator<< (Emitter &e, const std::map< std::string, T > &v) |
| Emitter & | operator<< (Emitter &e, bool v) |
| Emitter & | operator<< (Emitter &e, char v) |
| Emitter & | operator<< (Emitter &e, short v) |
| Emitter & | operator<< (Emitter &e, int v) |
| Emitter & | operator<< (Emitter &e, long v) |
| Emitter & | operator<< (Emitter &e, long long v) |
| Emitter & | operator<< (Emitter &e, unsigned char v) |
| Emitter & | operator<< (Emitter &e, unsigned short v) |
| Emitter & | operator<< (Emitter &e, unsigned int v) |
| Emitter & | operator<< (Emitter &e, unsigned long v) |
| Emitter & | operator<< (Emitter &e, unsigned long long v) |
| Emitter & | operator<< (Emitter &e, const char *v) |
| Emitter & | operator<< (Emitter &e, const std::string &v) |
| Emitter & | operator<< (Emitter &e, float v) |
| Emitter & | operator<< (Emitter &e, double v) |
| Emitter & | operator<< (Emitter &e, ConstBlobPtr v) |
| std::string | SerializeBundle (Variant v) |
| Bundle is a simple format used internally at ARL for passing around. | |
| void | SerializeBundle (const std::string &filename, Variant v) |
| void | SerializeBundle (FILE *f, Variant v) |
| void | SerializeBundle (std::streambuf *sb, Variant v) |
| unsigned | SerializeBundle (void *ptr, unsigned len, Variant v) |
| Variant | DeserializeBundle (const std::string &str) |
| Variant | DeserializeBundle (const void *ptr, unsigned len, bool be_safe=true) |
| If the be_safe parameter is false, then it is considered OK. | |
| Variant | DeserializeBundleFile (const char *filename) |
| Variant | DeserializeBundleFile (FILE *f) |
| Variant | DeserializeBundleFile (std::streambuf *sb) |
| std::ostream & | operator<< (std::ostream &os, const SchemaResult &sr) |
| bool | operator== (const Variant &lhs, const Variant &rhs) |
| bool | operator!= (const Variant &lhs, const Variant &rhs) |
| bool | operator< (const Variant &lhs, const Variant &rhs) |
| bool | operator> (const Variant &lhs, const Variant &rhs) |
| bool | operator<= (const Variant &lhs, const Variant &rhs) |
| bool | operator>= (const Variant &lhs, const Variant &rhs) |
| Variant | operator+ (const Variant &lhs, const Variant &rhs) |
| Variant | operator- (const Variant &lhs, const Variant &rhs) |
| Variant | operator* (const Variant &lhs, const Variant &rhs) |
| Variant | operator/ (const Variant &lhs, const Variant &rhs) |
| Variant | operator% (const Variant &lhs, const Variant &rhs) |
| template<typename T > | |
| T | variant_cast (const Variant &v) |
| std::string | SerializeJSON (Variant v, bool pretty=false) |
| void | SerializeJSON (const std::string &filename, Variant v, bool pretty=false) |
| void | SerializeJSON (FILE *f, Variant v, bool pretty=false) |
| void | SerializeJSON (std::streambuf *sb, Variant v, bool pretty=false) |
| unsigned | SerializeJSON (void *ptr, unsigned len, Variant v, bool pretty=false) |
| Variant | DeserializeJSON (const std::string &str) |
| Variant | DeserializeJSON (const char *str) |
| Variant | DeserializeJSON (const void *ptr, unsigned len) |
| Variant | DeserializeJSONFile (const char *filename) |
| Variant | DeserializeJSONFile (FILE *f) |
| Variant | DeserializeJSONFile (std::streambuf *sb) |
| std::string | SerializeYAML (Variant v) |
| void | SerializeYAML (const std::string &filename, Variant v) |
| void | SerializeYAML (FILE *f, Variant v) |
| void | SerializeYAML (std::streambuf *sb, Variant v) |
| unsigned | SerializeYAML (void *ptr, unsigned len, Variant v) |
| Variant | DeserializeYAML (const std::string &str) |
| Variant | DeserializeYAML (const char *str) |
| Variant | DeserializeYAML (const void *ptr, unsigned len) |
| Variant | DeserializeYAMLFile (const char *filename) |
| Variant | DeserializeYAMLFile (FILE *f) |
| Variant | DeserializeYAMLFile (std::streambuf *sb) |
| LoadAllIterator | DeserializeYAMLAll (const std::string &str) |
| LoadAllIterator | DeserializeYAMLAll (const char *str) |
| LoadAllIterator | DeserializeYAMLAll (const void *ptr, unsigned len) |
| LoadAllIterator | DeserializeYAMLAllFile (const char *filename) |
| LoadAllIterator | DeserializeYAMLAllFile (FILE *f) |
| LoadAllIterator | DeserializeYAMLAllFile (std::streambuf *sb) |
| std::string | SerializeXMLPLIST (Variant v, bool pretty=false) |
| void | SerializeXMLPLIST (const std::string &filename, Variant v, bool pretty=false) |
| void | SerializeXMLPLIST (FILE *f, Variant v, bool pretty=false) |
| void | SerializeXMLPLIST (std::streambuf *sb, Variant v, bool pretty=false) |
| unsigned | SerializeXMLPLIST (void *ptr, unsigned len, Variant v, bool pretty=false) |
| Variant | DeserializeXMLPLIST (const std::string &str) |
| Variant | DeserializeXMLPLIST (const char *str) |
| Variant | DeserializeXMLPLIST (const void *ptr, unsigned len) |
| Variant | DeserializeXMLPLISTFile (const char *filename) |
| Variant | DeserializeXMLPLISTFile (FILE *f) |
| Variant | DeserializeXMLPLISTFile (std::streambuf *sb) |
| std::string | SerializeBundleHdr (Variant v) |
| void | SerializeBundleHdr (const std::string &filename, Variant v) |
| void | SerializeBundleHdr (FILE *f, Variant v) |
| void | SerializeBundleHdr (std::streambuf *sb, Variant v) |
| unsigned | SerializeBundleHdr (void *ptr, unsigned len, Variant v) |
| Variant | DeserializeBundleHdr (const std::string &str) |
| Variant | DeserializeBundleHdr (const char *str) |
| Variant | DeserializeBundleHdr (const void *ptr, unsigned len) |
| Variant | DeserializeBundleHdrFile (const char *filename) |
| Variant | DeserializeBundleHdrFile (FILE *f) |
| Variant | DeserializeBundleHdrFile (std::streambuf *sb) |
Variables | |
| const char | ARG_PARSE_SCHEMA_STR [] |
| const char | JSON_SCHEMA_V4_SCHEMA [] |
| shared_ptr< SchemaStaticData > | schema_static_data |
libvariant library namespace
| void libvariant::AddSchemaDefaults | ( | Variant | schema, |
| VariantRef | data, | ||
| SchemaLoader * | loader = 0 |
||
| ) |
Add the defaults specified in schema to data if they do not exist. Ignores default in some combinations and types that could match multiple entries (not, additionalProperties, patternProperties, etc.) schema is processed the same as for SchemaValidate
| Emitter libvariant::BundleHdrEmitter | ( | shared_ptr< EmitterOutput > | o, |
| Variant | params = Variant::NullType |
||
| ) |
Supported params are:
"precision": integer (number of digits for floats)
| Emitter libvariant::CreateEmitter | ( | shared_ptr< EmitterOutput > | o, |
| SerializeType | type, | ||
| Variant | params = Variant::NullType |
||
| ) |
Create an Emiter that Emits the format specified by type. Supported parameters are dependent on type (see below).
| shared_ptr< ParserInput > libvariant::CreateParserInputFile | ( | std::streambuf * | sb | ) |
Create a parser input from the open streambuf pointer. Note that you can aquire the backing streambuf from an istream using the rdbuf() command.
| void libvariant::ExpandPathTo | ( | VariantRef | expand, |
| const Variant & | var, | ||
| Variant | params | ||
| ) |
Expands 'var' paths to 'expand' based on 'params'.
The current version of this funtion is fairly simple and cannot fully reverse the operation FlattenPathTo does on a variant with the same params argument. This primarily has to do with lists.
| Emitter libvariant::JSONEmitter | ( | shared_ptr< EmitterOutput > | o, |
| Variant | params = Variant::NullType |
||
| ) |
Create an Emitter that Emits the JSON format.
Supported parameters are: "pretty": boolean "indent": integer (number of spaces to indent when pretty is on, default 4) "precision": integer (number of digits for floats) "strict": be more strict about emitting correct json
| void libvariant::JSONPointerAdd | ( | const std::string & | pointer, |
| VariantRef | v, | ||
| Variant | data | ||
| ) |
Perform an operations on v according to RFC6901 and RFC6902.
Add data to v at the spot specified by pointer
| Emitter libvariant::MsgPackEmitter | ( | shared_ptr< EmitterOutput > | o, |
| Variant | params = Variant::NullType |
||
| ) |
No parameters supported.
| SchemaResult libvariant::SchemaValidate | ( | Variant | schema, |
| Variant | data, | ||
| SchemaLoader * | loader = 0 |
||
| ) |
Validate data against a schema.
The schema parameter is either a schema, a string uri to a schema, or null. If it is a schema then data is validated against it. If it is a string then it calls loader->GetSchema() and validates data against the result. If schema is null, then look for a key "$schema" in data, set schema to it and proceed as above.
| Emitter libvariant::XMLPLISTEmitter | ( | shared_ptr< EmitterOutput > | o, |
| Variant | params = Variant::NullType |
||
| ) |
Supported params are:
"pretty": true|false "indent": integer (amount to indent for pretty) "precision": integer (number of digits for floats)
| Emitter libvariant::YAMLEmitter | ( | shared_ptr< EmitterOutput > | o, |
| Variant | params = Variant::NullType |
||
| ) |
Supported parameters are (first is default):
"scalar_style": "any"|"plain"|"single quoted"|"double quoted"|"literal"|"folded"
"map_style": "any"|"block"|"flow"
"list_style": "any"|"block"|"flow"
"implicit_document_begin": false|true
"implicit_document_end": false|true
"indent": integer (number of spaces to indent)
"width": integer (set prefered line width)
"precision": integer (number of digits for floats)
1.8.7