| 47 | } |
| 48 | |
| 49 | util::StringID RegisteredStringMap::getStringID(std::string const &str) { |
| 50 | auto entry = std::find(begin(m_regEntries), end(m_regEntries), str); |
| 51 | if (end(m_regEntries) != entry) { |
| 52 | // we found it. |
| 53 | return util::StringID(std::distance(begin(m_regEntries), entry)); |
| 54 | } |
| 55 | |
| 56 | // we didn't find an entry in the registry so we'll add a new one |
| 57 | auto ret = util::StringID( |
| 58 | m_regEntries.size()); // will be the location of the next insert. |
| 59 | m_regEntries.push_back(str); |
| 60 | m_modified = true; |
| 61 | return ret; |
| 62 | } |
| 63 | |
| 64 | std::string RegisteredStringMap::getStringFromId(util::StringID id) const { |
| 65 |
no test coverage detected