#include <xmlstorage.h>
Public Member Functions | |
XMLPos (XMLNode *root) | |
XMLPos (const XMLPos &other) | |
XMLPos (XMLNode *node, const XS_String &name) | |
XMLPos (XMLNode *node, const XS_String &name, const XS_String &attr_name, const XS_String &attr_value) | |
XMLPos (const XMLPos &other, const XS_String &name) | |
XMLPos (const XMLPos &other, const XS_String &name, const XS_String &attr_name, const XS_String &attr_value) | |
XMLNode & | cur () |
access to current node | |
const XMLNode & | cur () const |
operator const XMLNode * () const | |
C++ access to current node. | |
operator XMLNode * () | |
const XMLNode * | operator-> () const |
XMLNode * | operator-> () |
const XMLNode & | operator * () const |
XMLNode & | operator * () |
XS_String | get (const XS_String &attr_name) const |
attribute access | |
void | put (const XS_String &attr_name, const XS_String &value) |
attribute setting | |
template<typename T> | |
XS_String | get (const T &attr_name) const |
C++ attribute access. | |
XS_String & | operator[] (const XS_String &attr_name) |
void | add_down (XMLNode *child) |
insert children when building tree | |
bool | back () |
go back to previous position | |
bool | go_down () |
go down to first child | |
bool | go_down (const XS_String &name, int n=0) |
search for child and go down | |
bool | go (const char *path) |
move XPath like to position in XML tree | |
bool | create_relative (const char *path) |
create child nodes using XPath notation and move to the deepest child | |
void | create (const XS_String &name) |
create node and move to it | |
void | smart_create (const XS_String &name) |
create node if not already existing and move to it | |
void | smart_create (const XS_String &name, const XS_String &attr_name, const XS_String &attr_value) |
search matching child node identified by key name and an attribute value | |
XS_String & | str () |
const XS_String & | str () const |
Protected Member Functions | |
void | go_to (XMLNode *child) |
go to specified node | |
Protected Attributes | |
XMLNode * | _root |
XMLNode * | _cur |
std::stack< XMLNode * > | _stack |
Definition at line 1248 of file xmlstorage.h.
XMLStorage::XMLPos::XMLPos | ( | XMLNode * | root | ) | [inline] |
XMLStorage::XMLPos::XMLPos | ( | const XMLPos & | other | ) | [inline] |
Definition at line 1262 of file xmlstorage.h.
01263 : _root(node), 01264 _cur(node) 01265 { 01266 smart_create(name); 01267 }
XMLStorage::XMLPos::XMLPos | ( | XMLNode * | node, | |
const XS_String & | name, | |||
const XS_String & | attr_name, | |||
const XS_String & | attr_value | |||
) | [inline] |
Definition at line 1269 of file xmlstorage.h.
01270 : _root(node), 01271 _cur(node) 01272 { 01273 smart_create(name, attr_name, attr_value); 01274 }
Definition at line 1276 of file xmlstorage.h.
01277 : _root(other._root), 01278 _cur(other._cur) 01279 { 01280 smart_create(name); 01281 }
XMLStorage::XMLPos::XMLPos | ( | const XMLPos & | other, | |
const XS_String & | name, | |||
const XS_String & | attr_name, | |||
const XS_String & | attr_value | |||
) | [inline] |
Definition at line 1283 of file xmlstorage.h.
01284 : _root(other._root), 01285 _cur(other._cur) 01286 { 01287 smart_create(name, attr_name, attr_value); 01288 }
XMLNode& XMLStorage::XMLPos::cur | ( | ) | [inline] |
access to current node
Definition at line 1291 of file xmlstorage.h.
01292 { 01293 return *_cur; 01294 }
const XMLNode& XMLStorage::XMLPos::cur | ( | ) | const [inline] |
XMLStorage::XMLPos::operator const XMLNode * | ( | ) | const [inline] |
XMLStorage::XMLPos::operator XMLNode * | ( | ) | [inline] |
const XMLNode* XMLStorage::XMLPos::operator-> | ( | ) | const [inline] |
XMLNode* XMLStorage::XMLPos::operator-> | ( | ) | [inline] |
const XMLNode& XMLStorage::XMLPos::operator * | ( | ) | const [inline] |
XMLNode& XMLStorage::XMLPos::operator * | ( | ) | [inline] |
attribute access
Definition at line 1312 of file xmlstorage.h.
01313 { 01314 return _cur->get(attr_name); 01315 }
attribute setting
Definition at line 1318 of file xmlstorage.h.
01319 { 01320 _cur->put(attr_name, value); 01321 }
XS_String XMLStorage::XMLPos::get | ( | const T & | attr_name | ) | const [inline] |
C++ attribute access.
Definition at line 1324 of file xmlstorage.h.
01324 {return (*_cur)[attr_name];}
void XMLStorage::XMLPos::add_down | ( | XMLNode * | child | ) | [inline] |
bool XMLStorage::XMLPos::back | ( | ) | [inline] |
bool XMLStorage::XMLPos::go_down | ( | ) | [inline] |
go down to first child
Definition at line 1346 of file xmlstorage.h.
01347 { 01348 XMLNode* node = _cur->get_first_child(); 01349 01350 if (node) { 01351 go_to(node); 01352 return true; 01353 } else 01354 return false; 01355 }
bool XMLStorage::XMLPos::go_down | ( | const XS_String & | name, | |
int | n = 0 | |||
) | [inline] |
search for child and go down
Definition at line 1358 of file xmlstorage.h.
01359 { 01360 XMLNode* node = _cur->find(name, n); 01361 01362 if (node) { 01363 go_to(node); 01364 return true; 01365 } else 01366 return false; 01367 }
bool XMLStorage::XMLPos::go | ( | const char * | path | ) |
move XPath like to position in XML tree
bool XMLStorage::XMLPos::create_relative | ( | const char * | path | ) | [inline] |
create child nodes using XPath notation and move to the deepest child
Definition at line 1373 of file xmlstorage.h.
01374 { 01375 XMLNode* node = _cur->create_relative(path); 01376 if (!node) 01377 return false; // invalid path specified 01378 01379 go_to(node); 01380 return true; 01381 }
void XMLStorage::XMLPos::create | ( | const XS_String & | name | ) | [inline] |
create node and move to it
Definition at line 1384 of file xmlstorage.h.
01385 { 01386 add_down(new XMLNode(name)); 01387 }
void XMLStorage::XMLPos::smart_create | ( | const XS_String & | name | ) | [inline] |
create node if not already existing and move to it
Definition at line 1390 of file xmlstorage.h.
01391 { 01392 XMLNode* node = _cur->find(name); 01393 01394 if (node) 01395 go_to(node); 01396 else 01397 add_down(new XMLNode(name)); 01398 }
void XMLStorage::XMLPos::smart_create | ( | const XS_String & | name, | |
const XS_String & | attr_name, | |||
const XS_String & | attr_value | |||
) | [inline] |
search matching child node identified by key name and an attribute value
Definition at line 1401 of file xmlstorage.h.
01402 { 01403 XMLNode* node = _cur->find(name, attr_name, attr_value); 01404 01405 if (node) 01406 go_to(node); 01407 else { 01408 node = new XMLNode(name); 01409 add_down(node); 01410 (*node)[attr_name] = attr_value; 01411 } 01412 }
XS_String& XMLStorage::XMLPos::str | ( | ) | [inline] |
const XS_String& XMLStorage::XMLPos::str | ( | ) | const [inline] |
void XMLStorage::XMLPos::go_to | ( | XMLNode * | child | ) | [inline, protected] |
XMLNode* XMLStorage::XMLPos::_root [protected] |
Definition at line 1464 of file xmlstorage.h.
XMLNode* XMLStorage::XMLPos::_cur [protected] |
Definition at line 1465 of file xmlstorage.h.
std::stack<XMLNode*> XMLStorage::XMLPos::_stack [protected] |
Definition at line 1466 of file xmlstorage.h.
IBrowser Source Code Documentation
generated on 18.09.2008 by |