MCPcopy Create free account
hub / github.com/ValveSoftware/openvr / Path_FixSlashes

Function Path_FixSlashes

samples/shared/pathtools.cpp:211–224  ·  view source on GitHub ↗

Fixes the directory separators for the current platform */

Source from the content-addressed store, hash-verified

209
210/** Fixes the directory separators for the current platform */
211std::string Path_FixSlashes( const std::string & sPath, char slash )
212{
213 if( slash == 0 )
214 slash = Path_GetSlash();
215
216 std::string sFixed = sPath;
217 for( std::string::iterator i = sFixed.begin(); i != sFixed.end(); i++ )
218 {
219 if( *i == '/' || *i == '\\' )
220 *i = slash;
221 }
222
223 return sFixed;
224}
225
226
227char Path_GetSlash()

Callers 7

Path_CompactFunction · 0.70
Path_IsDirectoryFunction · 0.70
Path_ExistsFunction · 0.70
Path_FilePathToUrlFunction · 0.70
Path_UrlToFilePathFunction · 0.70

Calls 3

beginMethod · 0.80
endMethod · 0.80
Path_GetSlashFunction · 0.70

Tested by

no test coverage detected