void ConfigScope::dump( StringBuffer & buf, bool wantExpandedUidNames, int indentLevel) const { int i; int len; StringVector nameVec; ConfigItem * item; //-------- // First pass. Dump the variables //-------- listLocalNames(Configuration::CFG_VARIABLES, nameVec); nameVec.sort(); len = nameVec.length(); for (i = 0; i < len; i++) { item = findItem(nameVec[i]); assert(item->type() & Configuration::CFG_VARIABLES); item->dump(buf, item->name(), wantExpandedUidNames, indentLevel); } //-------- // Second pass. Dump the nested scopes //-------- listLocalNames(Configuration::CFG_SCOPE, nameVec); nameVec.sort(); len = nameVec.length(); for (i = 0; i < len; i++) { item = findItem(nameVec[i]); assert(item->type() == Configuration::CFG_SCOPE); item->dump(buf, item->name(), wantExpandedUidNames, indentLevel); } }
inline void Configuration::print(bool desc) { for(Items::iterator i = items_.begin(); i != items_.end(); ++i) { ConfigItem* item = *i; std::cout << item->name() << ": "; item->print_value(std::cout); std::cout << "\n"; if(desc) { if(const char* desc = item->description()) { std::cout << " " << desc << "\n"; } std::cout << "\n"; } } }