mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 05:13:58 +00:00
[editor] remove error messages from CS comment and enforce OSM 255 char length limit (#919)
Signed-off-by: map-per <map-per@gmx.de>
This commit is contained in:
@@ -173,6 +173,29 @@ inline constexpr bool IsASCIISpace(T c)
|
||||
|
||||
bool IsASCIILatin(UniChar c);
|
||||
|
||||
/// Escape characters not allowed in XML
|
||||
template <typename T>
|
||||
std::string EscapeForXML(const T & in)
|
||||
{
|
||||
std::string result;
|
||||
result.reserve(in.size());
|
||||
|
||||
for (char c : in)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
case '&': result.append("&"); break;
|
||||
case '<': result.append("<"); break;
|
||||
case '>': result.append(">"); break;
|
||||
case '"': result.append("""); break;
|
||||
case '\'': result.append("'"); break;
|
||||
default: result.append(1, c); break;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
inline std::string DebugPrint(UniString const & s)
|
||||
{
|
||||
return ToUtf8(s);
|
||||
|
||||
Reference in New Issue
Block a user