1 #include "AttributeLookupTable.h"
4 namespace 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,
';'))
19 std::string attributeAssignment;
20 while (std::getline(ss, attributeAssignment,
','))
22 if (!attributeAssignment.empty())
27 std::stringstream aa_ss(attributeAssignment);
28 if (attributeAssignment.find(
"=") != std::string::npos)
30 if (!std::getline(aa_ss, name,
'='))
return false;
31 if (!std::getline(aa_ss, value))
return false;
35 if (!std::getline(aa_ss, name))
return false;
38 m_attributeLookupTable[name] = value;
44 if (std::getline(ss, token,
';'))
49 std::stringstream token_ss(token);
50 if (token.find(
"=") != std::string::npos)
52 if (!std::getline(token_ss, name,
'='))
return false;
53 if (!std::getline(token_ss, value))
return false;
56 m_attributeLookupTable[name] = value;