| 113 | } |
| 114 | |
| 115 | bool UnitFactory::registerEquivalentString(const std::string& equivalentString, const std::string& standardString) { |
| 116 | // register the pair |
| 117 | bool result = m_standardStringLookupMap.insert(StandardStringLookupMap::value_type(equivalentString, StringVector(1u, standardString))).second; |
| 118 | |
| 119 | if (!result) { |
| 120 | // equivalentString is already a key. add this one |
| 121 | m_standardStringLookupMap[equivalentString].push_back(standardString); |
| 122 | } |
| 123 | |
| 124 | return result; |
| 125 | } |
| 126 | |
| 127 | boost::optional<Unit> UnitFactory::createUnit(const std::string& unitString, UnitSystem system) const { |
| 128 | if (m_callbackMaps.empty()) { |