SAMMetadataTranslators.h
Go to the documentation of this file.
1 #ifndef art_Framework_Services_System_detail_SAMMetadataTranslators_h
2 #define art_Framework_Services_System_detail_SAMMetadataTranslators_h
3 
4 #include <map>
5 #include <string>
6 
7 namespace art {
8  namespace detail {
9 
10  using new_t = std::string;
11  using old_t = std::string;
12 
13  inline std::map<old_t, new_t>
15  {
16  return {{"fileType", "file_type"},
17  {"dataTier", "data_tier"},
18  {"streamName", "data_stream"},
19  {"runType", "run_type"}};
20  }
21 
22  //==============================================================================
23 
24  // Translator
25  struct OldToNew {
27  operator()(std::string const& name) const
28  {
29  auto const& transMap = oldToNewName();
30  auto it = transMap.find(name);
31  return it != transMap.cend() ? it->second : name;
32  }
33  };
34 
35  } // namespace detail
36 } // namespace art
37 
38 #endif /* art_Framework_Services_System_detail_SAMMetadataTranslators_h */
39 
40 // Local variables:
41 // mode: c++
42 // End:
static QCString name
Definition: declinfo.cpp:673
std::string string
Definition: nybbler.cc:12
std::map< old_t, new_t > oldToNewName()
std::string operator()(std::string const &name) const