MCPcopy Create free account
hub / github.com/comaps/comaps / ProcessCategory

Function ProcessCategory

libs/indexer/categories_holder.cpp:94–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94void ProcessCategory(std::string_view line, std::vector<std::string> & groups, std::vector<uint32_t> & types)
95{
96 // Check if category is a group reference.
97 if (line[0] == '@')
98 {
99 CHECK((groups.empty() || !types.empty()), ("Two groups in a group definition, line:", line));
100 groups.push_back(std::string(line));
101 return;
102 }
103
104 // Get classificator type.
105 uint32_t const type = classif().GetTypeByPathSafe(strings::Tokenize(line, "-"));
106 if (type == Classificator::INVALID_TYPE)
107 {
108 LOG(LWARNING, ("Invalid type when parsing the line:", line));
109 return;
110 }
111
112 types.push_back(type);
113}
114} // namespace
115
116// static

Callers 1

LoadFromStreamMethod · 0.85

Calls 4

GetTypeByPathSafeMethod · 0.80
TokenizeFunction · 0.50
emptyMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected