24#ifndef OMNIEVENTS__PERSIST_NODE_H
25#define OMNIEVENTS__PERSIST_NODE_H
40#ifdef HAVE_STD_IOSTREAM
54 void output(ostream& os,
string name)
const;
58 inline bool readtoken(istream& is,
string& tok);
60 void delnode(
const string& name);
61 void addattr(
const string& keyvalue);
62 void addattr(
const string& key,
long value);
65 bool hasAttr(
const string& key)
const;
66 string attrString(
const string& key,
const string& fallback=
"")
const;
67 long attrLong(
const string& key,
long fallback=0 )
const;
void output(ostream &os, string name) const
bool readtoken(istream &is, string &tok)
map< string, PersistNode * > _child
bool hasAttr(const string &key) const
map< string, string > _attr
~PersistNode()
Free node and all its children.
string attrString(const string &key, const string &fallback="") const
void delnode(const string &name)
PersistNode * addnode(const string &name)
bool readnode(istream &is)
long attrLong(const string &key, long fallback=0) const
PersistNode()
Create an empty node.
PersistNode * child(const string &key) const
void addattr(const string &keyvalue)