Klassen | Funktionen
Config

Klassen

class  configtree

Funktionen

void LoadRoutes (wxConfigBase *config)
void SaveRoutes (wxConfigBase *config)
virtual long configtree::Read (const mutStringRef key, long defval)
 Reads a long integer value.
virtual double configtree::Read (const mutStringRef key, double defval)
 Reads a double value.
virtual int configtree::Read (const mutStringRef key, int defval)
 Reads an integer value.
virtual bool configtree::Read (const mutStringRef key, bool defval)
 Reads a boolean value.
virtual mutString configtree::Read (const mutStringRef key, const mutStringRef defval)
 Reads a string value.
virtual void configtree::Write (const mutStringRef key, long value)
 Writes a long integer value.
virtual void configtree::Write (const mutStringRef key, double value)
 Writes a double value.
virtual void configtree::Write (const mutStringRef key, int value)
 Writes an integer value.
virtual void configtree::Write (const mutStringRef key, bool value)
 Writes a boolean value.
virtual void configtree::Write (const mutStringRef key, const mutStringRef value)
 Writes a string value.
virtual bool configtree::HasGroup (const mutStringRef subdir) const
 Checks if the tree has a branch with the given name.
virtual void configtree::toLeaf (const mutStringRef subdir)
 Changes the current node downwards.
virtual void configtree::toLeaf (const mutStringRef name, int id)
 Changes the current node downwards.
virtual int configtree::toFirstLeaf (const mutStringRef name, mutStringRef id)
 Changes the current node downdwards to the first leaf of given type.
virtual int configtree::toNextLeaf (const mutStringRef name, mutStringRef id)
 Changes the current node downdwards to the next leaf of given type.
virtual void configtree::toParent (unsigned int count=1)
 This function jumps up in the tree (i.e. towards the root).
virtual mutString configtree::GetPath ()
 Return a string representation of the position in the current tree.
virtual void configtree::SetPath (const mutStringRef path)
 Set the current pointer in the tree.

Dokumentation der Funktionen

mutString configtree::GetPath ( ) [virtual]

Return a string representation of the position in the current tree.

This function can be used to store the current position in the tree.

Rückgabewerte:
mutStringString representation of the current path. The concrete representation is implementation dependent and can vary for different tree types.

Implementiert tree_storage.

Definiert in Zeile 227 der Datei configtree.cpp.

Benutzt configtree::config.

Wird benutzt von configtree::toLeaf().

{
        return config -> GetPath();
}
bool configtree::HasGroup ( const mutStringRef  ) const [virtual]

Checks if the tree has a branch with the given name.

subdir (mutStringRef) subdirectory to check for.

Rückgabe:
true if the current node has a leaf with the given name which is a node itself.

Implementiert tree_storage.

Definiert in Zeile 92 der Datei configtree.cpp.

Benutzt configtree::config.

{
        return config->HasGroup(subdir);
}
void LoadRoutes ( wxConfigBase *  config) [inline]

Definiert in Zeile 136 der Datei configtree.h.

Benutzt LoadRoutes().

{
        configtree conf(config);
        LoadRoutes(conf);
}
double configtree::Read ( const mutStringRef  key,
double  defval 
) [virtual]

Reads a double value.

key (mutStringRef) Name of the desired leaf in the tree defval (double) default value, if the leaf is not availlable

Rückgabewerte:
dataread or defval, if the leaf does not exist.

Implementiert tree_storage.

Definiert in Zeile 47 der Datei configtree.cpp.

Benutzt configtree::config und configtree::Read().

{
        return config -> Read(key, defval);
}
int configtree::Read ( const mutStringRef  key,
int  defval 
) [virtual]

Reads an integer value.

key (mutStringRef) Name of the desired leaf in the tree defval (int) default value, if the leaf is not availlable

Rückgabewerte:
dataread or defval, if the leaf does not exist.

Implementiert tree_storage.

Definiert in Zeile 52 der Datei configtree.cpp.

Benutzt configtree::config und configtree::Read().

{
        return (int) config -> Read(key, (long) defval);
}
long configtree::Read ( const mutStringRef  key,
long  defval 
) [virtual]

Reads a long integer value.

key (mutStringRef) Name of the desired leaf in the tree defval (long) default value, if the leaf is not availlable

Rückgabewerte:
dataread or defval, if the leaf does not exist.

Implementiert tree_storage.

Definiert in Zeile 42 der Datei configtree.cpp.

Benutzt configtree::config.

Wird benutzt von configtree::Read().

{
        return config -> Read(key, defval);
}
bool configtree::Read ( const mutStringRef  key,
bool  defval 
) [virtual]

Reads a boolean value.

key (mutStringRef) Name of the desired leaf in the tree defval (bool) default value, if the leaf is not availlable

Rückgabewerte:
dataread or defval, if the leaf does not exist.

Implementiert tree_storage.

Definiert in Zeile 57 der Datei configtree.cpp.

Benutzt configtree::config und configtree::Read().

{ 
        return config -> Read(key, (long) defval);
}
mutString configtree::Read ( const mutStringRef  key,
const mutStringRef  defval 
) [virtual]

Reads a string value.

key (mutStringRef) Name of the desired leaf in the tree defval (mutStringRef) default value, if the leaf is not availlable

Rückgabewerte:
dataread or defval, if the leaf does not exist.

Implementiert tree_storage.

Definiert in Zeile 62 der Datei configtree.cpp.

Benutzt configtree::config und configtree::Read().

{
        return config -> Read(key, defval);
}
void SaveRoutes ( wxConfigBase *  config) [inline]

Definiert in Zeile 142 der Datei configtree.h.

Benutzt SaveRoutes().

{
        configtree conf(config);
        SaveRoutes(conf);
}
void configtree::SetPath ( const mutStringRef  path) [virtual]

Set the current pointer in the tree.

This function can be used to store the current position in the tree. path (mutString) String representation of the new path as returned by GetPath(). The concrete representation is implementation dependent and can vary for different tree types.

Implementiert tree_storage.

Definiert in Zeile 232 der Datei configtree.cpp.

Benutzt configtree::config und DEBUGLOG.

Wird benutzt von configtree::toLeaf() und configtree::toParent().

{
        DEBUGLOG(config,_T("setting path directly to '%s'"),path.c_str());
        config->SetPath(path);
}
int configtree::toFirstLeaf ( const mutStringRef  name,
mutStringRef  id 
) [virtual]

Changes the current node downdwards to the first leaf of given type.

this function can be used to navigate towards the leaves in the tree. The argument can be considered as Items with a unique id. subdir (mutStringRef) name of the entity to be read from. id (mutStringRef) reference to a String where the id of the leaf will be stored

Rückgabe:
(int) id of the selected item
Siehe auch:
toNextLeaf

Implementiert tree_storage.

Definiert in Zeile 133 der Datei configtree.cpp.

Benutzt configtree::state::chdepth, configtree::config, DEBUGLOG, configtree::state::leafid, name, configtree::states und configtree::toLeaf().

{
        DEBUGLOG(config,_T("going to first leaf of group '%s'"),name.c_str());
        toLeaf(name);
        state newstate = states.top();
        bool found = config->GetFirstGroup(id,newstate.leafid);
        if (!found) {
                id = _T("0");
                newstate.leafid = wxNOT_FOUND;
        }
        config->SetPath(id);
        newstate.chdepth++;
#ifdef DEBUG
        newstate.group=name;
#endif
        states.pop();
        states.push(newstate);
        DEBUGLOG(config,
                 _T("current path = '%s', old path = '%s', depth = %d, id = %d, name = '%s'"),
                 config->GetPath().c_str(), newstate.oldpath.c_str(), newstate.chdepth, 
                 newstate.leafid, newstate.group.c_str());
        return newstate.leafid;
}
void configtree::toLeaf ( const mutStringRef  subdir) [virtual]

Changes the current node downwards.

this function can be used to navigate towards the leaves in the tree. The argument can be considered like a subdirectory in a file system. subdir (mutStringRef) subdirectory to be written to.

Implementiert tree_storage.

Definiert in Zeile 97 der Datei configtree.cpp.

Benutzt configtree::state::chdepth, configtree::config, DEBUGLOG, configtree::GetPath(), configtree::state::leafid, configtree::SetPath(), configtree::states und UNREACHABLEC.

Wird benutzt von configtree::toFirstLeaf(), configtree::toLeaf() und configtree::toNextLeaf().

{
        DEBUGLOG(config,_T("going to group '%s'"),subdir.c_str());
        wxASSERT(subdir.Find('/') == wxNOT_FOUND);
        wxASSERT(subdir != _T(".."));
        if (subdir.Find('/') != wxNOT_FOUND || subdir == _T("..")) {
                UNREACHABLEC;
                return;
        }
        state newstate;
#ifdef DEBUG
        newstate.oldpath = config -> GetPath();
#endif
        DEBUGLOG(config,_T("setting path to '%s'"),(subdir).c_str());
        config -> SetPath(subdir);
        newstate.chdepth = 1;
        states.push(newstate);
        DEBUGLOG(config,_T("current path = '%s', old path = '%s', depth = %d, id = %d, name = '%s'"),
                 config->GetPath().c_str(), newstate.oldpath.c_str(), newstate.chdepth, 
                 newstate.leafid, newstate.group.c_str());
}
void configtree::toLeaf ( const mutStringRef  name,
int  id 
) [virtual]

Changes the current node downwards.

this function can be used to navigate towards the leaves in the tree. The argument can be considered as Items with a unique id. if the id is negative, it will create a new item. subdir (mutStringRef) name of the entity to be written to. id (int) id of the current object

Implementiert tree_storage.

Definiert in Zeile 119 der Datei configtree.cpp.

Benutzt configtree::state::chdepth, configtree::config, DEBUGLOG, configtree::state::leafid, configtree::states und configtree::toLeaf().

{
        DEBUGLOG(config,_T("going to group '%s' with id %d"),name.c_str(),id);
        toLeaf(name);
        state newstate = states.top();
        config->SetPath(wxString::Format(_T("%d"),id));
        newstate.chdepth++;
        states.pop();
        states.push(newstate);
        DEBUGLOG(config,_T("current path = '%s', old path = '%s', depth = %d, id = %d, name = '%s'"),
                 config->GetPath().c_str(), newstate.oldpath.c_str(), newstate.chdepth, 
                 newstate.leafid, newstate.group.c_str());
}
int configtree::toNextLeaf ( const mutStringRef  name,
mutStringRef  id 
) [virtual]

Changes the current node downdwards to the next leaf of given type.

this function can be used to navigate towards the leaves in the tree. The argument can be considered as Items with a unique id. subdir (mutStringRef) name of the entity to be read from. id (mutStringRef) reference to a String where the id of the leaf will be stored

Rückgabe:
(int) id of the selected item
Siehe auch:
toFirstLeaf

Implementiert tree_storage.

Definiert in Zeile 158 der Datei configtree.cpp.

Benutzt configtree::state::chdepth, configtree::config, DEBUGLOG, configtree::state::leafid, configtree::states, configtree::toLeaf() und configtree::toParent().

{
#ifdef DEBUG
        DEBUGLOG(config,_T("going to next leaf of group '%s'"),name.c_str());
        state oldstate=states.top();
        wxASSERT(oldstate.group==name);
        DEBUGLOG(config,
                 _T("current path = '%s', old path = '%s', depth = %d, id = %d, name = '%s'"),
                 config->GetPath().c_str(), 
                 oldstate.oldpath.c_str(), oldstate.chdepth, 
                 oldstate.leafid, oldstate.group.c_str());
#endif
        toParent(1);
        toLeaf(name);
        state newstate = states.top();
#ifdef DEBUG
        DEBUGLOG(config,
                 _T("current path = '%s', new old path = '%s', depth = %d, id = %d, name = '%s'"),
                 config->GetPath().c_str(), 
                 newstate.oldpath.c_str(), 
                 newstate.chdepth, newstate.leafid, newstate.group.c_str());
        wxASSERT(oldstate.oldpath == newstate.oldpath);
        newstate.group = oldstate.group;
#endif
        bool found = config->GetNextGroup(id, newstate.leafid);
        if (found) {
                config->SetPath(id);
                newstate.chdepth++;
        } else newstate.leafid=wxNOT_FOUND;
        states.pop();
        states.push(newstate);
        DEBUGLOG(config,
                 _T("current path = '%s', new old path = '%s', depth = %d, id = %d, name = '%s'"),
                 config->GetPath().c_str(), 
                 newstate.oldpath.c_str(), 
                 newstate.chdepth, newstate.leafid,
                 newstate.group.c_str());
        return newstate.leafid;
}
void configtree::toParent ( unsigned int  count = 1) [virtual]

This function jumps up in the tree (i.e. towards the root).

count (int) number of nodes to go upward. Default: 1.

Implementiert tree_storage.

Definiert in Zeile 199 der Datei configtree.cpp.

Benutzt configtree::state::chdepth, configtree::config, DEBUGLOG, configtree::state::leafid, configtree::SetPath(), configtree::states und UNREACHABLEC.

Wird benutzt von configtree::toNextLeaf().

{
        DEBUGLOG(config,_T("going up %d level groups"),count);
        while (count--) {
#ifdef DEBUG
                wxASSERT(states.size());
#endif
                if (!states.size()) {
                        UNREACHABLEC;
                        return;
                }
                state oldstate = states.top();
                DEBUGLOG(config,_T("going up for %d levels"),oldstate.chdepth);
                while (oldstate.chdepth--) 
                        config -> SetPath(_T(".."));
                states.pop();
#ifdef DEBUG
                wxASSERT(config->GetPath() == oldstate.oldpath);
#endif
                DEBUGLOG(config,
                         _T("current path = '%s', old path = '%s', depth = %d, id = %d, name = '%s'"),
                         config->GetPath().c_str(), 
                         oldstate.oldpath.c_str(), 
                         oldstate.chdepth, oldstate.leafid, 
                         oldstate.group.c_str());
        }
} 
void configtree::Write ( const mutStringRef  key,
long  value 
) [virtual]

Writes a long integer value.

key (mutStringRef) Name of the desired leaf in the tree value (long) value, to be written

Implementiert tree_storage.

Definiert in Zeile 67 der Datei configtree.cpp.

Benutzt configtree::config.

Wird benutzt von configtree::Write().

{
        config -> Write(key, value);
}
void configtree::Write ( const mutStringRef  key,
int  value 
) [virtual]

Writes an integer value.

key (mutStringRef) Name of the desired leaf in the tree value (int) value, to be written

Implementiert tree_storage.

Definiert in Zeile 77 der Datei configtree.cpp.

Benutzt configtree::config und configtree::Write().

{
        config -> Write (key, (long) value);
}
void configtree::Write ( const mutStringRef  key,
const mutStringRef  value 
) [virtual]

Writes a string value.

key (mutStringRef) Name of the desired leaf in the tree value (mutStringRef) value, to be written

Implementiert tree_storage.

Definiert in Zeile 87 der Datei configtree.cpp.

Benutzt configtree::config und configtree::Write().

{       
        config -> Write (key, value);
}
void configtree::Write ( const mutStringRef  key,
bool  value 
) [virtual]

Writes a boolean value.

key (mutStringRef) Name of the desired leaf in the tree value (bool) value, to be written

Implementiert tree_storage.

Definiert in Zeile 82 der Datei configtree.cpp.

Benutzt configtree::config und configtree::Write().

{
        config -> Write(key, (long) value);
}
void configtree::Write ( const mutStringRef  key,
double  value 
) [virtual]

Writes a double value.

key (mutStringRef) Name of the desired leaf in the tree value (double) value, to be written

Implementiert tree_storage.

Definiert in Zeile 72 der Datei configtree.cpp.

Benutzt configtree::config und configtree::Write().

{
        config -> Write (key, value);
}

Erzeugt am Sun Aug 21 2011 10:52:05 für Mutabor von doxygen 1.7.4