yconf.cpp 751 B

123456789101112131415161718
  1. #include "yconf.h"
  2. TLogBackendCreatorInitContextYConf::TLogBackendCreatorInitContextYConf(const TYandexConfig::Section& section)
  3. : Section(section)
  4. {}
  5. bool TLogBackendCreatorInitContextYConf::GetValue(TStringBuf name, TString& var) const {
  6. return Section.GetDirectives().GetValue(name, var);
  7. }
  8. TVector<THolder<ILogBackendCreator::IInitContext>> TLogBackendCreatorInitContextYConf::GetChildren(TStringBuf name) const {
  9. TVector<THolder<IInitContext>> result;
  10. auto children = Section.GetAllChildren();
  11. for (auto range = children.equal_range(TCiString(name)); range.first != range.second; ++range.first) {
  12. result.emplace_back(MakeHolder<TLogBackendCreatorInitContextYConf>(*range.first->second));
  13. }
  14. return result;
  15. }