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

Function buildHotReloadOptions

Examples/SCExample/SCExample.cpp:62–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60};
61
62static Result buildHotReloadOptions(HotReloadOptionsStorage& storage)
63{
64 StringPath executablePath;
65 SC_TRY_MSG(not FileSystem::Operations::getExecutablePath(executablePath).isEmpty(),
66 "SCExample could not resolve executable path");
67
68 String executableDirectory = StringEncoding::Utf8;
69 SC_TRY(executableDirectory.assign(Path::dirname(executablePath.view(), Path::AsNative)));
70
71 const StringView compiledLibraryRoot =
72 StringView::fromNullTerminated(SC_COMPILER_LIBRARY_PATH, StringEncoding::Utf8);
73 const StringView compiledExtraIncludePaths =
74 StringView::fromNullTerminated(SC_HOT_RELOAD_INCLUDE_PATHS, StringEncoding::Utf8);
75
76 String libraryRoot = StringEncoding::Utf8;
77 SC_TRY(resolveCompiledPathFromExecutableDirectory(compiledLibraryRoot, executableDirectory.view(), libraryRoot));
78
79 SC_TRY(Path::join(storage.examplesPath, {libraryRoot.view(), "Examples", "SCExample", "Examples"}));
80 String normalizedExamplesPath = StringEncoding::Utf8;
81 SC_TRY(Path::normalize(normalizedExamplesPath, storage.examplesPath.view(), Path::AsNative));
82 storage.examplesPath = move(normalizedExamplesPath);
83 SC_TRY(appendLine(storage.defaultIncludePathsText, compiledLibraryRoot));
84 SC_TRY(appendLine(storage.defaultIncludePathsText, compiledExtraIncludePaths));
85 return Result(true);
86}
87
88struct ApplicationState
89{

Callers 1

createMethod · 0.85

Calls 11

getExecutablePathFunction · 0.85
dirnameFunction · 0.85
fromNullTerminatedFunction · 0.85
normalizeFunction · 0.85
appendLineFunction · 0.85
joinFunction · 0.50
ResultClass · 0.50
isEmptyMethod · 0.45
assignMethod · 0.45
viewMethod · 0.45

Tested by

no test coverage detected