Exemplo n.º 1
0
Config*
Config::mutable_child( const std::string& childName )
{
    for( ConfigSet::iterator i = _children.begin(); i != _children.end(); i++ ) {
        if ( i->key() == childName )
            return &(*i);
    }

    return 0L;
}
Exemplo n.º 2
0
Config*
Config::find( const std::string& key, bool checkMe )
{
    if ( checkMe && key == this->key() )
        return this;

    for( ConfigSet::iterator c = _children.begin(); c != _children.end(); ++c )
        if ( key == c->key() )
            return &(*c);

    for( ConfigSet::iterator c = _children.begin(); c != _children.end(); ++c )
    {
        Config* r = c->find(key, false);
        if ( r ) return r;
    }

    return 0L;
}