MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / convertToOSPath

Function convertToOSPath

TheForceEngine/TFE_FileSystem/fileutil.cpp:271–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

269 }
270
271 void convertToOSPath(const char* path, char* pathOS)
272 {
273#ifdef _WIN32
274 const size_t len = strlen(path);
275 for (size_t i = 0; i < len; i++)
276 {
277 if (path[i] == '/')
278 {
279 pathOS[i] = '\\';
280 }
281 else
282 {
283 pathOS[i] = path[i];
284 }
285 }
286#else
287 const size_t len = strlen(path);
288 for (size_t i = 0; i < len; i++)
289 {
290 if (path[i] == '\\')
291 {
292 pathOS[i] = '/';
293 }
294 else
295 {
296 pathOS[i] = path[i];
297 }
298 }
299#endif
300 pathOS[len] = 0;
301 }
302
303 void replaceExtension(const char* srcPath, const char* newExt, char* outPath)
304 {

Callers 3

openFileDialogFunction · 0.50
directorySelectDialogFunction · 0.50
saveFileDialogFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected