summaryrefslogtreecommitdiff
path: root/src/cnode/cnode.hpp
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2010-11-17 19:19:51 -0800
committerAn-Cheng Huang <ancheng@vyatta.com>2010-11-17 19:19:51 -0800
commit6c21b63190de70898ee4eacd66687d9759242331 (patch)
tree530df0166eb0ce54f1d048330653a635a1cd6882 /src/cnode/cnode.hpp
parent1a2eac7485f52d93e1334a3818e5a4d420709db2 (diff)
downloadvyatta-cfg-6c21b63190de70898ee4eacd66687d9759242331.tar.gz
vyatta-cfg-6c21b63190de70898ee4eacd66687d9759242331.zip
continue work on parser/output framework
* handle empty and leaf typeless nodes from parsed nodes. * fix bug 6436 show level issue.
Diffstat (limited to 'src/cnode/cnode.hpp')
-rw-r--r--src/cnode/cnode.hpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cnode/cnode.hpp b/src/cnode/cnode.hpp
index 4d4990b..40fb5b6 100644
--- a/src/cnode/cnode.hpp
+++ b/src/cnode/cnode.hpp
@@ -40,6 +40,7 @@ public:
bool isLeafTypeless() const { return _is_leaf_typeless; }
bool isInvalid() const { return _is_invalid; }
bool isEmpty() const { return _is_empty; }
+ bool exists() const { return _exists; }
const std::string& getName() const { return _name; }
const std::string& getValue() const { return _value; }
@@ -48,7 +49,10 @@ public:
const std::vector<CfgNode *>& getChildNodes() const { return _child_nodes; }
void addMultiValue(char *val) { _values.push_back(val); }
- void addChildNode(CfgNode *cnode) { _child_nodes.push_back(cnode); }
+ void addChildNode(CfgNode *cnode) {
+ _child_nodes.push_back(cnode);
+ _is_empty = false;
+ }
void setValue(char *val) { _value = val; }
private:
@@ -61,6 +65,7 @@ private:
bool _is_leaf_typeless;
bool _is_invalid;
bool _is_empty;
+ bool _exists;
std::string _name;
std::string _value;
std::vector<std::string> _values;