blob: 9f6ee1a54e624ff977f42e6d6184534effe118f2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#include "types_mapping.hpp"
#include "classificator.hpp"
#include "../base/string_utils.hpp"
#include "../base/stl_add.hpp"
void IndexAndTypeMapping::Load(istream & s)
{
Classificator const & c = classif();
string v;
vector<string> path;
uint32_t ind = 0;
while (s.good())
{
v.clear();
s >> v;
if (!v.empty())
{
path.clear();
strings::Tokenize(v, "|", MakeBackInsertFunctor(path));
Add(ind++, c.GetTypeByPath(path));
}
}
}
void IndexAndTypeMapping::Add(uint32_t ind, uint32_t type)
{
ASSERT_EQUAL ( ind, m_types.size(), () );
m_types.push_back(type);
VERIFY ( m_map.insert(make_pair(type, ind)).second, (classif().GetFullObjectName(type), ind) );
}
|