22 #pragma warning(disable : 4503) // "decorated name length exceeded, name was truncated"
28 AliasEquals(
const std::string &alias) : m_Alias(alias) {}
29 bool operator()(
const std::pair<std::string, std::vector<std::string>> &element)
31 std::vector<std::string>::const_iterator iter = std::find(element.second.begin(), element.second.end(), m_Alias);
32 return iter != element.second.end();
48 const std::string &alias,
49 const std::string &className)
54 AliasesMap &aliases = m_Aliases[className];
55 AliasesMapIterator iter = aliases.find(propertyName);
57 if (iter != aliases.end())
59 if (std::find(iter->second.begin(), iter->second.end(), alias) == iter->second.end())
60 iter->second.push_back(alias);
64 aliases.insert(std::make_pair(propertyName, std::vector<std::string>(1, alias)));
71 const std::string &className)
73 if (!propertyName.empty())
75 AliasesMap &aliases = m_Aliases[className];
76 AliasesMapConstIterator iter = aliases.find(propertyName);
78 if (iter != aliases.end())
82 return std::vector<std::string>();
89 AliasesMap &aliases = m_Aliases[className];
90 AliasesMapConstIterator iter = std::find_if(aliases.begin(), aliases.end(), AliasEquals(alias));
92 if (iter != aliases.end())
101 const AliasesMap &aliases = m_Aliases[className];
103 return !propertyName.empty() ? aliases.find(propertyName) != aliases.end() :
false;
107 const std::string &alias,
108 const std::string &className)
110 if (!propertyName.empty() && !alias.empty())
112 AliasesMap &aliases = m_Aliases[className];
113 AliasesMapIterator iter = aliases.find(propertyName);
115 if (iter != aliases.end())
117 std::vector<std::string>::iterator aliasIter = std::find(iter->second.begin(), iter->second.end(), alias);
119 if (aliasIter != iter->second.end())
121 iter->second.erase(aliasIter);
123 if (iter->second.empty())
124 aliases.erase(propertyName);
132 if (!propertyName.empty())
134 AliasesMap &aliases = m_Aliases[className];
135 aliases.erase(propertyName);
141 AliasesMap &aliases = m_Aliases[className];
std::string GetPropertyName(const std::string &alias, const std::string &className) override
Get property name that is associated to specific alias.
bool HasAliases(const std::string &propertyName, const std::string &className) override
Check if a specific property has aliases.
bool AddAlias(const std::string &propertyName, const std::string &alias, const std::string &className) override
Add an alias for a specific property.
void RemoveAliases(const std::string &propertyName, const std::string &className) override
Remove all aliases of a specific property.
std::vector< std::string > GetAliases(const std::string &propertyName, const std::string &className) override
Get aliases for a specific property.
void RemoveAlias(const std::string &propertyName, const std::string &alias, const std::string &className) override
Remove specific alias of a certain property.
void RemoveAllAliases(const std::string &className) override
Remove all aliases of all properties.