MCPcopy Create free account
hub / github.com/Rezonality/zep / StringId

Class StringId

include/zep/mcommon/string/stringutils.h:91–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89std::string string_tolower(const std::string& str);
90
91struct StringId
92{
93 uint32_t id = 0;
94 StringId()
95 {
96 }
97 StringId(const char* pszString);
98 StringId(const std::string& str);
99 explicit StringId(uint32_t _id)
100 {
101 id = _id;
102 }
103
104 bool operator==(const StringId& rhs) const
105 {
106 return id == rhs.id;
107 }
108 const StringId& operator=(const char* pszString);
109 const StringId& operator=(const std::string& str);
110 bool operator<(const StringId& rhs) const
111 {
112 return id < rhs.id;
113 }
114
115 operator uint32_t() const
116 {
117 return id;
118 }
119 std::string ToString() const
120 {
121 auto itr = GetStringLookup().find(id);
122 if (itr == GetStringLookup().end())
123 {
124 return "murmur:" + std::to_string(id);
125 }
126 return itr->second;
127 }
128
129 static std::unordered_map<uint32_t, std::string>& GetStringLookup();
130};
131
132inline std::ostream& operator<<(std::ostream& str, StringId id)
133{

Callers 2

keymap_findFunction · 0.85
ExCommandIdMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected