1#include "AttributeLookupTable.h"
4namespace Odb::Lib::FileModel::Design
6 const std::map<std::string, std::string>& AttributeLookupTable::GetAttributeLookupTable()
const
8 return m_attributeLookupTable;
11 bool AttributeLookupTable::ParseAttributeLookupTable(
const std::string& attributeLookupTableString)
13 std::stringstream ss(attributeLookupTableString);
17 if (!std::getline(ss, token,
';'))
21 if (std::getline(ss, token,
';'))
23 std::stringstream attributesStream(token);
24 std::string attributeAssignment;
25 while (std::getline(attributesStream, attributeAssignment,
','))
27 if (!attributeAssignment.empty())
32 std::stringstream aa_ss(attributeAssignment);
33 if (attributeAssignment.find(
"=") != std::string::npos)
35 if (!std::getline(aa_ss, name,
'='))
return false;
36 if (!std::getline(aa_ss, value))
return false;
40 if (!std::getline(aa_ss, name))
return false;
43 m_attributeLookupTable[name] = value;
49 if (std::getline(ss, token,
';'))
54 std::stringstream token_ss(token);
55 if (token.find(
"=") != std::string::npos)
57 if (!std::getline(token_ss, name,
'='))
return false;
58 if (!std::getline(token_ss, value))
return false;
61 m_attributeLookupTable[name] = value;