diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2010-07-30 09:53:00 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2010-07-30 09:53:00 -0700 |
commit | dc4bd2c05375cece9d1c1281cbebbef40a09c4e4 (patch) | |
tree | 1ad940cb817d22726b1e1f763f12b0e11f3a5acc /src/cstore/cstore.cpp | |
parent | 56dc9db80960f62f021958baba29c49dda895b03 (diff) | |
download | vyatta-cfg-dc4bd2c05375cece9d1c1281cbebbef40a09c4e4.tar.gz vyatta-cfg-dc4bd2c05375cece9d1c1281cbebbef40a09c4e4.zip |
add default status observers
Diffstat (limited to 'src/cstore/cstore.cpp')
-rw-r--r-- | src/cstore/cstore.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/cstore/cstore.cpp b/src/cstore/cstore.cpp index e97ea2c..c829f6e 100644 --- a/src/cstore/cstore.cpp +++ b/src/cstore/cstore.cpp @@ -853,7 +853,7 @@ Cstore::setCfgPath(const vector<string>& path_comps) append_cfg_path(path_comps); pop_cfg_path(); // only do it if it's previously marked default - if (marked_display_default()) { + if (marked_display_default(false)) { ret = unmark_display_default(); /* XXX work around current commit's unionfs implementation problem. @@ -1448,6 +1448,20 @@ Cstore::cfgPathGetComment(const vector<string>& path_comps, string& comment, return ret; } +/* return whether specified path is "default". if a node is "default", it + * is currently not shown by the "show" command unless "-all" is specified. + * active_cfg: whether to observe active config. + */ +bool +Cstore::cfgPathDefault(const vector<string>& path_comps, bool active_cfg) +{ + SAVE_PATHS; + append_cfg_path(path_comps); + bool ret = marked_display_default(active_cfg); + RESTORE_PATHS; + return ret; +} + /* the following functions are observers of the "effective" config. * they can be used * (1) outside a config session (e.g., op mode, daemons, callbacks, etc.). |