MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / formatError

Method formatError

Libraries/FileSystem/FileSystem.cpp:424–453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

422}
423
424SC::Result SC::FileSystem::formatError(int errorNumber, StringSpan item, bool isWindowsNativeError)
425{
426#if SC_PLATFORM_WINDOWS
427 if (isWindowsNativeError)
428 {
429 if (not preciseErrorMessages)
430 {
431 return Result::Error("Windows Error");
432 }
433 if (not Internal::formatWindowsError(errorNumber, errorMessageBuffer))
434 {
435 return Result::Error("SC::FileSystem::formatError - Cannot format error");
436 }
437 }
438 else
439#endif
440 {
441 (void)(isWindowsNativeError);
442 if (not preciseErrorMessages)
443 {
444 return getErrorCode(errorNumber);
445 }
446 if (not Internal::formatError(errorNumber, errorMessageBuffer))
447 {
448 return Result::Error("SC::FileSystem::formatError - Cannot format error");
449 }
450 }
451 (void)item; // TODO: Append item name
452 return Result::FromStableCharPointer(errorMessageBuffer);
453}
454
455SC::Result SC::FileSystem::rename(StringSpan path, StringSpan newPath)
456{

Callers

nothing calls this directly

Calls 2

getErrorCodeFunction · 0.85
ErrorEnum · 0.50

Tested by

no test coverage detected