MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / formatStringForMasterServer

Function formatStringForMasterServer

source/utils/MasterServer.cpp:120–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118 }
119
120 std::string formatStringForMasterServer(const std::string& str)
121 {
122 // We replace special meaning chars
123 std::string formatted;
124 for(auto it = str.begin(); it != str.end(); ++it)
125 {
126 char c = *it;
127 bool isSecialChar = false;
128 for(const std::pair<char,char>& specialChar : specialChars)
129 {
130 if(c == specialChar.first)
131 {
132 formatted += replacementChar;
133 formatted += specialChar.second;
134 isSecialChar = true;
135 break;
136 }
137 }
138 if(isSecialChar)
139 continue;
140
141 formatted += c;
142 }
143
144 return formatted;
145 }
146
147 std::string formatStringFromMasterServer(const std::string& str)
148 {

Callers 1

registerGameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected