diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2010-11-17 19:19:51 -0800 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2010-11-17 19:19:51 -0800 |
commit | 6c21b63190de70898ee4eacd66687d9759242331 (patch) | |
tree | 530df0166eb0ce54f1d048330653a635a1cd6882 /src/cnode/cnode.hpp | |
parent | 1a2eac7485f52d93e1334a3818e5a4d420709db2 (diff) | |
download | vyatta-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.hpp | 7 |
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; |