void Config::dumpConfig(TDirectory* const dir, std::string const name) { if (dir) { TObjArray array(getEnv().GetTable()->GetSize()); array.SetOwner(kTRUE); TIter next(getEnv().GetTable()); TEnvRec *er; static const char *lc[] = { "Global", "User", "Local", "Changed" }; size_t index = 0; while ((er = (TEnvRec*) next())) { TObjString* str = new TObjString(Form("%-25s: %-30s [%s]", er->GetName(), er->GetValue(), lc[er->GetLevel()])); array[index] = str; ++index; } // while dir->cd(); array.Write(name.c_str(),TObject::kSingleKey); // array.Write(); } return; }
void Config::dumpConfig(std::ostream& stream) { TIter next(getEnv().GetTable()); TEnvRec *er; static const char *lc[] = { "Global", "User", "Local", "Changed" }; stream << "cafe::Config: Dumping configuration settings" << std::endl; while ((er = (TEnvRec*) next())) stream << Form("%-25s: %-30s [%s]", er->GetName(),er->GetValue(),lc[er->GetLevel()]) << std::endl; stream << "cafe::Config: End of configuration settings" << std::endl; return; }