MCPcopy Create free account
hub / github.com/Panzerschrek/Chasm-Reverse / MakeQuotedString

Function MakeQuotedString

PanzerChasm/settings.cpp:84–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84static std::string MakeQuotedString( const std::string& str )
85{
86 std::string result;
87 result.reserve( str.size() + 3u );
88 result+= "\"";
89
90 const char* s= str.c_str();
91 while( *s != '\0' )
92 {
93 if( *s == '"' || *s == '\\' )
94 result+= '\\';
95 result+= *s;
96 s++;
97 }
98
99 result += "\"";
100 return result;
101}
102
103Settings::Settings( const char* file_name )
104 : file_name_(file_name)

Callers 1

~SettingsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected