24 #include "Internal.hpp" 49 explicit Context(
const char *search_dir =
nullptr,
int options = 0);
51 Context(
const char *search_dir,
const char *path,
LYD_FORMAT format,
int options = 0);
53 Context(
const char *search_dir,
LYD_FORMAT format,
const char *data,
int options = 0);
84 S_Module
get_module(
const char *name,
const char *revision =
nullptr,
int implemented = 0);
88 S_Module
load_module(
const char *name,
const char *revision =
nullptr);
90 S_Module
get_module_by_ns(
const char *ns,
const char *revision =
nullptr,
int implemented = 0);
92 S_Submodule
get_submodule(
const char *module,
const char *revision =
nullptr,
const char *submodule =
nullptr,
const char *sub_revision =
nullptr);
94 S_Submodule
get_submodule2(S_Module main_module,
const char *submodule =
nullptr);
96 S_Schema_Node
get_node(S_Schema_Node start,
const char *data_path,
int output = 0);
100 S_Set
find_path(
const char *schema_path);
134 friend std::vector<S_Error>
get_ly_errors(S_Context context);
141 static const char*
cpp_mod_missing_cb(
const char *mod_name,
const char *mod_rev,
const char *submod_name,
const char *sub_rev,
void *user_data,
LYS_INFORMAT *format,
void(**free_module_data)(
void *model_data,
void *user_data));
169 const char *
errmsg()
const throw() {
return eitem->
msg ? eitem->
msg :
"";};
198 std::vector<S_Data_Node>
data();
200 std::vector<S_Schema_Node>
schema();
206 int add(S_Data_Node node,
int options = 0);
208 int add(S_Schema_Node node,
int options = 0);
216 int rm(S_Data_Node node);
218 int rm(S_Schema_Node node);
std::vector< void * > wrap_cb_l
LY_LOG_LEVEL set_log_verbosity(LY_LOG_LEVEL level)
S_Module get_module_by_ns(const char *ns, const char *revision=nullptr, int implemented=0)
Error(struct ly_err_item *eitem)
std::vector< const mod_missing_deleter_t * > mod_missing_deleter
const char * errmsg() const
LY_VECODE
libyang's codes of validation error. Whenever ly_errno is set to LY_EVALID, the ly_vecode is also set...
LY_ERR
libyang's error codes available via ly_errno extern variable.
void unset_disable_searchdir_cwd()
struct ly_ctx * swig_ctx()
S_Module load_module(const char *name, const char *revision=nullptr)
S_Set find_path(const char *schema_path)
std::vector< S_Module > get_disabled_module_iter()
std::vector< std::pair< mod_missing_cb_t, mod_missing_deleter_t > > mod_missing_cb
class for wrapping ly_err_item.
S_Data_Node parse_data_xml(S_Xml_Elem elem, int options=0)
void set_disable_searchdir_cwd()
class for wrapping ly_ctx.
void ly_ctx_unset_prefer_searchdirs(struct ly_ctx *ctx)
Reverse function to ly_ctx_set_prefer_searchdirs().
S_Data_Node parse_data_path(const char *path, LYD_FORMAT format, int options=0)
static void cpp_mod_missing_deleter(void *data, void *user_data)
S_Data_Node parse_data_fd(int fd, LYD_FORMAT format, int options=0)
S_Module parse_module_path(const char *path, LYS_INFORMAT format)
S_Submodule get_submodule2(S_Module main_module, const char *submodule=nullptr)
const char * errpath() const
void unset_prefer_searchdirs()
The main libyang public header.
friend std::vector< S_Error > get_ly_errors(S_Context context)
LYD_FORMAT
Data input/output formats supported by libyang parser and printer functions.
void add_missing_module_callback(const mod_missing_cb_t &callback, const mod_missing_deleter_t &deleter=mod_missing_deleter_t())
Add a missing include or import module callback.
S_Data_Node parse_data_mem(const char *data, LYD_FORMAT format, int options=0)
Structure to hold a set of (not necessary somehow connected) lyd_node or lys_node objects....
std::vector< std::string > get_searchdirs()
S_Module get_module(const char *name, const char *revision=nullptr, int implemented=0)
Libyang full error structure.
std::function< mod_missing_cb_return(const char *mod_name, const char *mod_rev, const char *submod_name, const char *sub_rev)> mod_missing_cb_t
int add(S_Data_Node node, int options=0)
void ly_ctx_unset_allimplemented(struct ly_ctx *ctx)
Reverse function to ly_ctx_set_allimplemented().
std::vector< S_Schema_Node > schema()
std::vector< S_Error > get_ly_errors(S_Context context)
void set_prefer_searchdirs()
int contains(S_Data_Node node)
void ly_ctx_unset_disable_searchdir_cwd(struct ly_ctx *ctx)
Reverse function to ly_ctx_set_disable_searchdir_cwd().
const char * errapptag() const
LYS_INFORMAT
Schema input formats accepted by libyang parser functions.
std::function< void(void *)> mod_missing_deleter_t
void unset_allimplemented()
void ly_ctx_set_disable_searchdir_cwd(struct ly_ctx *ctx)
Make context to stop implicitly searching for schemas (imported, included or requested via ly_ctx_loa...
int set_log_options(int options)
std::vector< S_Schema_Node > data_instantiables(int options)
Context(struct ly_ctx *ctx, S_Deleter deleter)
void set_disable_searchdirs()
void unset_searchdirs(int idx)
S_Module get_module_older(S_Module module)
LY_LOG_LEVEL
Verbosity levels of the libyang logger.
void unset_disable_searchdirs()
void ly_ctx_unset_searchdirs(struct ly_ctx *ctx, int index)
Clean the search path(s) from the libyang context.
S_Module parse_module_mem(const char *data, LYS_INFORMAT format)
std::vector< S_Data_Node > data()
S_Module parse_module_fd(int fd, LYS_INFORMAT format)
std::vector< S_Module > get_module_iter()
class for wrapping ly_set.
int set_searchdir(const char *search_dir)
S_Schema_Node get_node(S_Schema_Node start, const char *data_path, int output=0)
S_Submodule get_submodule(const char *module, const char *revision=nullptr, const char *submodule=nullptr, const char *sub_revision=nullptr)
void ly_ctx_set_allimplemented(struct ly_ctx *ctx)
Make context to set all the imported modules to be implemented. By default, if the imported module is...
void set_allimplemented()
S_Context create_new_Context(struct ly_ctx *ctx)
void ly_ctx_set_disable_searchdirs(struct ly_ctx *ctx)
Make context to stop searching for schemas (imported, included or requested via ly_ctx_load_module())...
void ly_ctx_set_prefer_searchdirs(struct ly_ctx *ctx)
Prefer context's searchdirs before the user callback (ly_module_imp_clb) provided via ly_ctx_set_modu...
int rm_index(unsigned int index)
static const char * cpp_mod_missing_cb(const char *mod_name, const char *mod_rev, const char *submod_name, const char *sub_rev, void *user_data, LYS_INFORMAT *format, void(**free_module_data)(void *model_data, void *user_data))
void ly_ctx_unset_disable_searchdirs(struct ly_ctx *ctx)
Reverse function to ly_ctx_set_disable_searchdirs().