summaryrefslogtreecommitdiff
path: root/src/cnode
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2010-11-15 20:43:53 -0800
committerAn-Cheng Huang <ancheng@vyatta.com>2010-11-15 20:43:53 -0800
commit239bed10328b12736e4f0fe55cc6df4ff46227a7 (patch)
treefa38a97d8d82a60ba66e7d4d6953e01213df7f58 /src/cnode
parent58ca1cd7f857b8cde91c063ccdda1b661c29e278 (diff)
downloadvyatta-cfg-239bed10328b12736e4f0fe55cc6df4ff46227a7.tar.gz
vyatta-cfg-239bed10328b12736e4f0fe55cc6df4ff46227a7.zip
continue config file parser work
Diffstat (limited to 'src/cnode')
-rw-r--r--src/cnode/cnode-algorithm.cpp2
-rw-r--r--src/cnode/cnode.cpp5
-rw-r--r--src/cnode/cnode.hpp1
3 files changed, 5 insertions, 3 deletions
diff --git a/src/cnode/cnode-algorithm.cpp b/src/cnode/cnode-algorithm.cpp
index c830ce4..6926c74 100644
--- a/src/cnode/cnode-algorithm.cpp
+++ b/src/cnode/cnode-algorithm.cpp
@@ -164,9 +164,9 @@ _diff_check_and_show_leaf(CfgNode *cfg1, CfgNode *cfg2, int level,
}
}
+ _diff_print_comment(cfg1, cfg2, level);
if (cfg->isMulti()) {
// multi-value node
- _diff_print_comment(cfg1, cfg2, level);
if (force_pfx_diff) {
// simple case: just use the same diff prefix for all values
const vector<string>& vvec = cfg->getValues();
diff --git a/src/cnode/cnode.cpp b/src/cnode/cnode.cpp
index 0f6976d..05dc07a 100644
--- a/src/cnode/cnode.cpp
+++ b/src/cnode/cnode.cpp
@@ -27,7 +27,6 @@ using namespace std;
using namespace cnode;
/* XXX
- from cstore: extra level for tag node
delayed processing for _is_empty, _is_leaf_typeless
*/
@@ -56,9 +55,11 @@ CfgNode::CfgNode(vector<string>& path_comps, char *name, char *val,
vtw_def def;
if (cstore->validateTmplPath(path_comps, false, def)) {
// got the def
- _is_value = def.is_value;
_is_tag = def.tag;
_is_leaf = (!def.tag && def.def_type != ERROR_TYPE);
+
+ // match constructor from cstore (leaf node never _is_value)
+ _is_value = (def.is_value && !_is_leaf);
_is_multi = def.multi;
/* XXX given the current definition of "default", the concept of
diff --git a/src/cnode/cnode.hpp b/src/cnode/cnode.hpp
index aab2d4d..4d4990b 100644
--- a/src/cnode/cnode.hpp
+++ b/src/cnode/cnode.hpp
@@ -49,6 +49,7 @@ public:
void addMultiValue(char *val) { _values.push_back(val); }
void addChildNode(CfgNode *cnode) { _child_nodes.push_back(cnode); }
+ void setValue(char *val) { _value = val; }
private:
bool _is_tag;