#include <Variant/SchemaLoader.h>
Public Member Functions | |
| void | AddPath (const std::string &path) |
| virtual bool | HandleMissing (const std::string &uri, LoaderError &error) |
Public Member Functions inherited from libvariant::SchemaLoader | |
| SchemaLoader (SchemaLoader *b) | |
| virtual Variant | GetSchema (const std::string &uri) |
|
virtual std::map< std::string, Variant > | AddSchema (const std::string &uri, Variant schema) |
| virtual void | ForgetSchema (const std::string &uri) |
| void | SetMissingHandler (MissingHandlerType, void *ctx) |
Protected Member Functions | |
| bool | LoadFromFile (URIInfo &info, LoaderError &error) |
| bool | LoadFromCurl (URIInfo &info, LoaderError &error) |
Protected Attributes | |
| std::vector< std::string > | paths |
Protected Attributes inherited from libvariant::SchemaLoader | |
| MissingHandlerType | missingHandler |
| void * | missingctx |
| std::map< std::string, Variant > | schemas |
| SchemaLoader * | base |
Additional Inherited Members | |
Public Types inherited from libvariant::SchemaLoader | |
| typedef bool(* | MissingHandlerType )(SchemaLoader *, const std::string &, LoaderError &, void *) |
Static Public Member Functions inherited from libvariant::SchemaLoader | |
| static void | NormSchema (Variant &schema, const std::string &uri) |
| static std::string | ResolveURI (const std::string &base, const std::string &href) |
| static bool | ParseURI (URIInfo &info, const std::string &uri) |
Static Protected Member Functions inherited from libvariant::SchemaLoader | |
| static void | SearchForTrustedSchemas (std::map< std::string, Variant > &m, Variant schema, const std::string &uri) |
The advanced schema loader will try to load missing schemas from the file system and optionally curl if built. If the url begins with file:// it will always use LoadFromFile otherwise if the protocol is empty it will try loading from a file then try loading from curl. Otherwise if the protocol is not file:// it will try to load from curl.
| void libvariant::AdvSchemaLoader::AddPath | ( | const std::string & | path | ) |
The advanced schema loader will search for a schema in the paths added to it on the file system. If the schema uri looks like a relative path, then it will be searched for in the paths set with this function. If no paths are added, then only absolute paths will be looked up in the file system.
1.8.7