MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / getDasRoot

Function getDasRoot

src/misc/sysos.cpp:638–665  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

636 }
637
638 string getDasRoot ( void ) {
639 if ( g_dasRoot.empty() ) {
640 string efp = getExecutableFileName(); // ?/bin/debug/binary.exe
641 auto np = efp.find_last_of("\\/");
642 if ( np != string::npos ) {
643 auto ep = get_prefix(efp); // remove file name
644 auto suffix = get_suffix(ep);
645 if ( suffix != "bin" ) {
646 ep = get_prefix(ep); // remove debug
647 }
648 if ( get_suffix(ep)!="bin" ) {
649 g_dasRoot = ".";
650 } else {
651 g_dasRoot = get_prefix(ep); // remove bin
652 }
653 #ifdef DAS_INSTALL_BINDIR
654 if ( ep == DAS_INSTALL_BINDIR ) {
655 g_dasRoot = DAS_INSTALL_DATADIR;
656 }
657 #endif
658 // make paths consistent on UNIX and Windows
659 replace(g_dasRoot.begin(), g_dasRoot.end(), '\\', '/');
660 } else {
661 g_dasRoot = ".";
662 }
663 }
664 return g_dasRoot;
665 }
666}

Callers 15

makeWebSocketServerFunction · 0.85
aot_compileFunction · 0.85
das_aot_mainFunction · 0.85
compile_and_runFunction · 0.85
MAIN_FUNC_NAMEFunction · 0.85
mainFunction · 0.85
introduceDaslibMethod · 0.85
getModuleInfoMethod · 0.85
getPrerequisitsFunction · 0.85
compileDaScriptFunction · 0.85
das_get_rootFunction · 0.85
find_linkerFunction · 0.85

Calls 7

getExecutableFileNameFunction · 0.85
get_prefixFunction · 0.85
get_suffixFunction · 0.85
replaceFunction · 0.85
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected