145 #include <sys/stat.h>
156 #include "TargetConditionals.h"
160 #include <mach-o/dyld.h>
165 #define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR)
169 #define S_ISREG(mode) (((mode)&S_IFMT) == S_IFREG)
173 #define OT_APPDATA_DIR "OpenTransactions"
174 #elif TARGET_OS_IPHONE
175 #define OT_APPDATA_DIR "Documents"
177 #define OT_APPDATA_DIR "ot"
179 #define OT_APPDATA_DIR ".ot"
182 #ifndef OT_PREFIX_PATH
184 #define OT_PREFIX_PATH \
185 OTPaths::AppDataFolder() // windows, set to OT AppData Folder.
186 #elif TARGET_OS_IPHONE
187 #define OT_PREFIX_PATH \
188 OTPaths::AppDataFolder() // iphone, set to OT AppData Folder.
190 #define OT_PREFIX_PATH \
191 "res/raw" // android, set to res/raw folder for static files in android app
194 #define OT_PREFIX_PATH "/usr/local" // default prefix_path unix
198 #define OT_INIT_CONFIG_FILENAME "ot_init.cfg"
199 #define OT_CONFIG_ISRELATIVE "_is_relative"
202 #define OT_SCRIPTS_DIR "scripts/ot"
203 #elif defined(ANDROID)
204 #define OT_SCRIPTS_DIR ""
206 #define OT_SCRIPTS_DIR "lib/opentxs"
213 OTSettings OTPaths::s_settings;
215 OTSettings OTPaths::s_settings(GlobalConfigFile());
219 OTString OTPaths::s_strAppBinaryFolder(
"");
220 OTString OTPaths::s_strHomeFolder(
"");
221 OTString OTPaths::s_strAppDataFolder(
"");
222 OTString OTPaths::s_strGlobalConfigFile(
"");
223 OTString OTPaths::s_strPrefixFolder(
"");
224 OTString OTPaths::s_strScriptsFolder(
"");
232 return OTPaths::s_strAppBinaryFolder;
237 OTPaths::s_strAppBinaryFolder = strLocation;
242 return OTPaths::s_strHomeFolder;
247 OTPaths::s_strHomeFolder = strLocation;
256 if (s_strAppDataFolder.
Exists())
257 return s_strAppDataFolder;
260 strAppDataFolder(
"");
270 FixPath(strHomeDataFolder, strHomeDataFolder,
true);
281 s_strAppDataFolder = strAppDataFolder;
283 return s_strAppDataFolder;
288 if (s_strGlobalConfigFile.
Exists())
289 return s_strGlobalConfigFile;
297 s_strGlobalConfigFile = strGlobalConfigFile;
299 return s_strGlobalConfigFile;
304 if (s_strPrefixFolder.
Exists())
305 return s_strPrefixFolder;
309 return s_strPrefixFolder;
317 if (s_strScriptsFolder.
Exists())
318 return s_strScriptsFolder;
322 return s_strScriptsFolder;
355 const bool bPreLoaded(config.IsLoaded());
359 if (!config.Load()) {
368 if (!strDefaultPrefixPath.
Exists()) {
369 otErr << __FUNCTION__ <<
": Error: OT_PREFIX_PATH is not set!";
375 if (OTPaths::Win_GetInstallFolderFromRegistry(strTemp)) {
376 strDefaultPrefixPath = strTemp;
380 if (!ToReal(strDefaultPrefixPath, strDefaultPrefixPath)) {
383 if (!FixPath(strDefaultPrefixPath, strDefaultPrefixPath,
true)) {
389 bool bPrefixPathOverride =
false;
396 OTString strPrefixPathOverride(
"prefix_path_override");
398 if (!config.CheckSet_str(
"paths",
"prefix_path",
399 strDefaultPrefixPath, strConfigPath,
403 if (!config.CheckSet_bool(
404 "paths", strPrefixPathOverride,
false, bPrefixPathOverride,
405 bIsNew,
"; This will force the prefix not to change")) {
413 otErr << __FUNCTION__ <<
": Error: Bad "
415 <<
" in config, will reset!";
417 strConfigPath = strDefaultPrefixPath;
418 bPrefixPathOverride =
false;
421 bool bNewOrUpdate =
false;
422 if (!config.Set_str(
"paths",
"prefix_path",
423 strDefaultPrefixPath, bNewOrUpdate)) {
426 if (!config.Set_bool(
"paths", strPrefixPathOverride,
false,
432 strLocalPrefixPath = strConfigPath;
436 if (!bPrefixPathOverride) {
437 bool bUpdate =
false;
440 if (!strLocalPrefixPath.
Compare(strDefaultPrefixPath)) {
441 strLocalPrefixPath = strDefaultPrefixPath;
446 if (strPrefixFolder.Exists() &&
447 (3 < strPrefixFolder.GetLength())) {
452 if (!ToReal(strTmp, strTmp)) {
456 if (!FixPath(strTmp, strTmp,
true)) {
460 if (!strLocalPrefixPath.
Compare(strTmp)) {
461 strLocalPrefixPath = strTmp;
468 bool bNewOrUpdate =
false;
469 if (!config.Set_str(
"paths",
"prefix_path",
470 strLocalPrefixPath, bNewOrUpdate)) {
478 if (!strLocalPrefixPath.
Exists()) {
482 if (!ToReal(strLocalPrefixPath, strLocalPrefixPath)) {
485 if (!FixPath(strLocalPrefixPath, strLocalPrefixPath,
true)) {
488 s_strPrefixFolder = strLocalPrefixPath;
493 if (!config.Save()) {
506 const bool& bIsRelative
509 const bool bPreLoaded(config.IsLoaded());
513 if (!config.Load()) {
522 bool bConfigIsRelative =
false;
527 bool bKeyIsNew =
false;
529 if (!config.CheckSet_bool(
"paths", strRelativeKey,
true,
530 bConfigIsRelative, bKeyIsNew)) {
534 strConfigFolder, bKeyIsNew)) {
541 if ((strScriptsFolder.Exists()) && (3 < strScriptsFolder.GetLength())) {
546 if (bConfigIsRelative != bIsRelative) {
548 bConfigIsRelative = bIsRelative;
549 bool bNewOrUpdated =
false;
551 if (!config.Set_bool(
"paths", strRelativeKey, bConfigIsRelative,
557 if (!strConfigFolder.
Compare(strScriptsFolder)) {
559 strConfigFolder = strScriptsFolder;
560 bool bNewOrUpdated =
false;
562 if (!config.Set_str(
"paths",
"scripts", strConfigFolder,
569 if (bConfigIsRelative) {
570 if (!FixPath(strConfigFolder, strConfigFolder,
true)) {
575 AppendFolder(strPrefixScriptPath, PrefixFolder(), strConfigFolder);
577 OTString strAppBinaryScriptPath =
"";
586 if (AppBinaryFolder().
Exists()) {
587 AppendFolder(strAppBinaryScriptPath, AppBinaryFolder(),
590 otOut << __FUNCTION__
591 <<
": Warning: Cannot Find: " << strAppBinaryScriptPath
592 <<
", using default!";
593 strAppBinaryScriptPath =
"";
597 s_strScriptsFolder = strAppBinaryScriptPath.
Exists()
598 ? strAppBinaryScriptPath
599 : strPrefixScriptPath;
601 if (!s_strScriptsFolder.Exists())
OT_FAIL;
605 if (!ToReal(strConfigFolder, strConfigFolder)) {
609 if (!FixPath(strConfigFolder, strConfigFolder,
true)) {
612 s_strScriptsFolder = strConfigFolder;
616 if (!config.Save()) {
627 bool& out_bIsRelative,
bool& out_bKeyExist)
629 if (!strSection.
Exists()) {
630 otErr << __FUNCTION__ <<
": Null: "
636 otErr << __FUNCTION__ <<
": Null: "
643 out_bIsRelative =
false;
644 out_bKeyExist =
false;
646 const bool bPreLoaded(config.
IsLoaded());
650 if (!config.Load()) {
655 bool bBoolExists(
false), bIsRelative(
false);
656 OTString strRelativeKey(
""), strOutFolder(
"");
660 if (config.
Check_bool(strSection, strRelativeKey, bIsRelative,
662 bool bStringExists =
false;
663 if (config.
Check_str(strSection, strKey, strOutFolder, bStringExists)) {
664 if (bBoolExists && bStringExists) {
668 if (!
ToReal(strOutFolder, strOutFolder)) {
672 if (!
FixPath(strOutFolder, strOutFolder,
true)) {
677 out_strVar = strOutFolder;
678 out_bIsRelative = bIsRelative;
679 out_bKeyExist =
true;
683 out_bIsRelative =
false;
684 out_bKeyExist =
false;
701 const bool& bIsRelative,
bool& out_bIsNewOrUpdated,
704 if (!strSection.
Exists()) {
705 otErr << __FUNCTION__ <<
": Null: "
711 otErr << __FUNCTION__ <<
": Null: "
717 out_bIsNewOrUpdated =
false;
719 const bool bPreLoaded(config.
IsLoaded());
724 if (!config.Load()) {
729 bool bBoolIsNew(
false);
734 if (config.
Set_bool(strSection, strRelativeKey, bIsRelative, bBoolIsNew,
736 bool bStringIsNew =
false;
737 if (config.
Set_str(strSection, strKey, strValue, bStringIsNew)) {
738 if (bBoolIsNew && bStringIsNew)
740 out_bIsNewOrUpdated =
true;
744 if (!config.Save()) {
760 const bool& bIsFolder)
763 otErr << __FUNCTION__ <<
": Null: "
769 std::string l_strPath(strPath.
Get());
771 std::string l_strPath_noBackslash(
776 if (
'/' == *l_strPath_noBackslash.rbegin()) {
778 out_strFixedPath.
Set(l_strPath_noBackslash.c_str());
782 out_strFixedPath.
Set(
783 l_strPath_noBackslash.substr(0, l_strPath_noBackslash.size() -
790 l_strPath_noBackslash +=
"/";
791 out_strFixedPath.
Set(l_strPath_noBackslash.c_str());
795 out_strFixedPath.
Set(l_strPath_noBackslash.c_str());
805 otErr << __FUNCTION__ <<
": Null: "
812 std::string l_strPath(strPath.
Get());
816 std::string l_strPath_stat(
"");
819 if (
'/' == *l_strPath.rbegin())
820 l_strPath_stat = l_strPath.substr(0, l_strPath.size() - 1);
822 l_strPath_stat = l_strPath;
825 memset(&st, 0,
sizeof(st));
828 stat(l_strPath_stat.c_str(), &st))
830 if (
'/' != *l_strPath.rbegin()) {
844 if (!strFilePath.
Exists()) {
845 otErr << __FUNCTION__ <<
": Null: "
852 std::string l_strPath(strFilePath.
Get());
855 if (
'/' != *l_strPath.rbegin()) {
857 std::string l_strPath_stat = l_strPath;
859 memset(&st_buf, 0,
sizeof(st_buf));
863 strcpy_s(filename, l_strPath_stat.c_str());
864 _stat(filename, &st_buf);
867 memset(&st_buf, 0,
sizeof(st_buf));
868 stat(l_strPath.c_str(), &st_buf);
874 size_t lFileLength = st_buf.st_size;
875 nFileLength =
static_cast<int64_t
>(lFileLength);
885 if (!strFolderPath.
Exists()) {
886 otErr << __FUNCTION__ <<
": Null: "
893 std::string l_strPath(strFolderPath.
Get());
896 if (
'/' == *l_strPath.rbegin()) {
898 std::string l_strPath_stat = l_strPath.substr(0, l_strPath.size() - 1);
900 memset(&st_buf, 0,
sizeof(st_buf));
901 char filename[4086] =
"";
904 strcpy_s(filename, l_strPath_stat.c_str());
905 _stat(filename, &st_buf);
908 memset(&st_buf, 0,
sizeof(st_buf));
909 stat(l_strPath.c_str(), &st_buf);
922 bool& out_Exists,
bool& out_IsNew)
924 const bool bExists = (strExactPath.
Exists() && !strExactPath.
Compare(
""));
927 "OTPaths::ConfirmCreateFolder: Assert failed: no strFolderName\n");
929 std::string l_strExactPath(strExactPath.
Get());
931 if (
'/' != *l_strExactPath.rbegin())
return false;
944 bool bCreateDirSuccess = (_mkdir(strExactPath.
Get()) == 0);
946 bool bCreateDirSuccess = (mkdir(strExactPath.
Get(), 0700) == 0);
949 if (!bCreateDirSuccess) {
950 otErr <<
"OTPaths::" << __FUNCTION__ <<
": Unable To Confirm "
952 << strExactPath <<
".\n";
964 bool bCheckDirExist =
PathExists(strExactPath);
966 if (!bCheckDirExist) {
967 otErr <<
"OTPaths::" << __FUNCTION__
969 "Unable To Confirm Created Directory " << strExactPath
988 if (!strExactPath.
Exists()) {
989 otErr << __FUNCTION__ <<
": Null: "
998 const char* szPath = strExactPath.
Get();
999 size_t newsize = strlen(szPath) + 1;
1000 wchar_t* wzPath =
new wchar_t[newsize];
1002 size_t convertedChars = 0;
1003 mbstowcs_s(&convertedChars, wzPath, newsize, szPath, 4096);
1005 wchar_t szBuf[4096] = L
"";
1007 if (GetFullPathName(wzPath, 4096, szBuf,
nullptr)) {
1012 out_strCanonicalPath.
Set(
"");
1017 char_t szBuf[4096] =
"";
1018 char_t
const* szPath = strRealPath.Get();
1020 if (GetFullPathName(szPath, 4096, szBuf,
nullptr)) {
1021 out_strCanonicalPath.
Set(szBuf);
1025 out_strCanonicalPath.
Set(
"");
1032 char* actualpath = realpath(strExactPath.
Get(), NULL);
1033 if (actualpath == NULL) {
1035 if (errno == ENOTDIR) {
1036 otWarn <<
"Input value to RealPath is not a directory: (Realpath: "
1038 out_strCanonicalPath.
Set(strExactPath);
1042 if (errno == ENOENT) {
1043 otWarn <<
"File doesn't exist: (Realpath: skipping)\n";
1044 out_strCanonicalPath.
Set(strExactPath);
1048 OT_ASSERT_MSG((errno != EACCES),
"Error (Realpath: EACCES): Unable to "
1049 "build RealPath: access denied");
1052 "Error (RealPath: EINVAL): Input value into RealPath was nullptr");
1055 "Error (RealPath: ELOOP): Resloving links resulted in a loop.");
1057 "Error (RealPath: ENAMETOOLONG): Name too int64_t.");
1058 OT_ASSERT_MSG((errno != ERANGE),
"Error (RealPath: ERANGE): Resulting "
1059 "path is too int64_t for the buffer");
1061 "Error (RealPath: EIO): Unable to access path.");
1065 "Error (RealPath: OTHER): Something bad Happend with 'realpath'.");
1067 out_strCanonicalPath.
Set(actualpath);
1075 #ifdef TARGET_OS_MAC
1076 char bufPath[PATH_MAX + 1] =
"";
1077 uint32_t size =
sizeof(bufPath);
1078 if (_NSGetExecutablePath(bufPath, &size) == 0)
1079 strExecutablePath.
Set(bufPath);
1082 #elif defined __linux__
1084 char buff[4096] =
"";
1085 ssize_t len = ::readlink(
"/proc/self/exe", buff,
sizeof(buff) - 1);
1088 strExecutablePath.
Set(buff);
1091 strExecutablePath.
Set(
"");
1095 #elif defined _WIN32
1098 TCHAR bufPath[_MAX_PATH + 1] = L
"";
1100 TCHAR bufPath[_MAX_PATH + 1] =
"";
1103 GetModuleFileName(
nullptr, bufPath,
sizeof(bufPath) /
sizeof(TCHAR));
1108 strExecutablePath.
Set(bufPath);
1121 TCHAR* szPath =
nullptr;
1124 #define GetCurrentDir _wgetcwd
1127 #define GetCurrentDir _getcwd
1131 #define GetCurrentDir getcwd
1132 char* szPath =
nullptr;
1148 strCurrentWorkingPath.
Set(szPath);
1159 TCHAR szPath[MAX_PATH] = L
"";
1161 TCHAR szPath[MAX_PATH] =
"";
1164 if (SUCCEEDED(SHGetFolderPath(
nullptr, CSIDL_APPDATA | CSIDL_FLAG_CREATE,
1165 nullptr, 0, szPath))) {
1169 out_strHomeFolder.
Set(szPath);
1173 out_strHomeFolder.
Set(
"");
1177 out_strHomeFolder.
Set(getenv(
"HOME"));
1185 bool OTPaths::Win_GetInstallFolderFromRegistry(
OTString& out_InstallFolderPath)
1187 WindowsRegistryTools windowsRegistryTools;
1190 LONG lRes = RegOpenKeyExW(
1191 HKEY_LOCAL_MACHINE, L
"SOFTWARE\\Open-Transactions", 0, KEY_READ, &hKey);
1192 bool bExistsAndSuccess(lRes == ERROR_SUCCESS);
1193 bool bDoesNotExistsSpecifically(lRes == ERROR_FILE_NOT_FOUND);
1195 std::wstring strValueOfBinDir;
1196 windowsRegistryTools.GetStringRegKey(hKey, L
"Path", strValueOfBinDir,
1199 if (bExistsAndSuccess && !bDoesNotExistsSpecifically) {
1200 std::string strInstallPath(OTString::ws2s(strValueOfBinDir));
1201 out_InstallFolderPath.
Set(strInstallPath.c_str());
1215 if (!strBasePath.
Exists()) {
1216 otErr << __FUNCTION__ <<
": Null: "
1221 if (!strFolderName.
Exists()) {
1222 otErr << __FUNCTION__ <<
": Null: "
1228 OTString l_strBasePath_fix(
""), l_strFolderName_fix(
"");
1230 if (!
FixPath(strBasePath, l_strBasePath_fix,
true))
return false;
1231 if (!
FixPath(strFolderName, l_strFolderName_fix,
true))
return false;
1233 std::string l_strBasePath(l_strBasePath_fix.Get()),
1234 l_strFolderName(l_strFolderName_fix.
Get());
1236 l_strBasePath.append(l_strFolderName);
1238 const OTString l_strPath(l_strBasePath);
1240 out_strPath = l_strPath;
1248 if (!strBasePath.
Exists()) {
1249 otErr << __FUNCTION__ <<
": Null: "
1254 if (!strFileName.
Exists()) {
1255 otErr << __FUNCTION__ <<
": Null: "
1261 OTString l_strBasePath_fix(
""), l_strFileName_fix(
"");
1263 if (!
FixPath(strBasePath, l_strBasePath_fix,
true))
return false;
1264 if (!
FixPath(strFileName, l_strFileName_fix,
false))
return false;
1266 std::string l_strBasePath(l_strBasePath_fix.Get()),
1267 l_strFileName(l_strFileName_fix.
Get());
1269 l_strBasePath.append(l_strFileName);
1271 const OTString l_strPath(l_strBasePath);
1273 out_strPath = l_strPath;
1284 if (!strBasePath.
Exists()) {
1285 otErr << __FUNCTION__ <<
": Null: "
1290 if (!strRelativePath.
Exists()) {
1291 otErr << __FUNCTION__ <<
": Null: "
1292 <<
"strRelativePath"
1298 if (!
FixPath(strBasePath, l_strBasePath_fix,
true))
return false;
1300 if (strRelativePath.
Compare(
".")) {
1301 out_strCanonicalPath = strBasePath;
1305 std::string l_strBasePath(l_strBasePath_fix.
Get()),
1306 l_strRelativePath(strRelativePath.
Get());
1308 l_strBasePath.append(l_strRelativePath);
1310 OTString l_strPath(l_strBasePath), l_strCanonicalPath(
"");
1312 if (!
ToReal(l_strPath, l_strCanonicalPath))
return false;
1314 out_strCanonicalPath = l_strCanonicalPath;
1321 bool& out_bFolderCreated)
1323 out_bFolderCreated =
false;
1325 OTString l_strFolderPath_fix(
""), l_strFolderPath_real(
"");
1327 if (!
ToReal(strFolderPath, l_strFolderPath_real))
1330 if (!
FixPath(l_strFolderPath_real, l_strFolderPath_fix,
true))
1333 std::string l_strFolderPath(l_strFolderPath_fix.Get());
1335 std::vector<std::string> vFolders;
1339 size_t nSize = vFolders.size();
1341 std::string l_strPathPart(
"");
1342 bool l_FolderExists(
false), l_bBuiltFolder(
false);
1346 for (
size_t i = 0; i < nSize; i++) {
1347 #ifndef _WIN32 // aka UNIX
1348 if (0 == i) l_strPathPart +=
"/";
1350 l_strPathPart += vFolders[i];
1351 l_strPathPart +=
"/";
1353 if (0 == i)
continue;
1355 OTString strPathPart(l_strPathPart);
1359 if (bLog && l_bBuiltFolder)
1360 otOut << __FUNCTION__ <<
": Made new folder: " << l_strPathPart
1363 if (!out_bFolderCreated && l_bBuiltFolder) out_bFolderCreated =
true;
1370 bool& out_bFolderCreated)
1372 out_bFolderCreated =
false;
1374 OTString l_strFilePath_fix(
""), l_strFilePath_real(
"");
1376 if (!
ToReal(strFolderPath, l_strFilePath_real))
1379 if (!
FixPath(l_strFilePath_real, l_strFilePath_fix,
false))
1382 std::string l_strFilePath(l_strFilePath_fix.Get());
1384 std::vector<std::string> vFolders;
1388 size_t nSize = vFolders.size();
1390 std::string l_strPathPart(
"");
1391 bool l_FolderExists(
false), l_bBuiltFolder(
false);
1395 for (
size_t i = 0; i < nSize; i++) {
1396 #ifndef _WIN32 // aka UNIX
1397 if (0 == i) l_strPathPart +=
"/";
1400 l_strPathPart += vFolders[i];
1402 if ((i + 1) == nSize)
continue;
1404 l_strPathPart +=
"/";
1406 if (0 == i)
continue;
1408 OTString strPathPart(l_strPathPart);
1411 if (bLog && l_bBuiltFolder)
1412 otOut << __FUNCTION__ <<
": Made new folder: " << l_strPathPart
1415 if (!out_bFolderCreated && l_bBuiltFolder) out_bFolderCreated =
true;
static EXPORT bool FileExists(const OTString &strFilePath, int64_t &nFileLength)
static EXPORT bool LoadSetPrefixFolder(OTSettings &config=s_settings, const OTString &strPrefixFolder="")
EXPORT bool Check_str(const OTString &strSection, const OTString &strKey, OTString &out_strResult, bool &out_bKeyExist) const
static EXPORT bool Set(OTSettings &config, const OTString &strSection, const OTString &strKey, const OTString &strValue, const bool &bIsRelative, bool &out_bIsNewOrUpdated, const OTString &strComment="")
EXPORT bool Set_bool(const OTString &strSection, const OTString &strKey, const bool &bValue, bool &out_bNewOrUpdate, const OTString &strComment="")
static EXPORT void SetAppBinaryFolder(OTString strLocation)
OTLOG_IMPORT OTLogStream otOut
static EXPORT bool ToReal(const OTString &strExactPath, OTString &out_strCanonicalPath)
static EXPORT bool BuildFolderPath(const OTString &strFolderPath, bool &out_bFolderCreated)
EXPORT uint32_t GetLength() const
static EXPORT const OTString & PrefixFolder()
#define OT_CONFIG_ISRELATIVE
static EXPORT bool RelativeToCanonical(OTString &out_strCanonicalPath, const OTString &strBasePath, const OTString &strRelativePath)
EXPORT bool Exists() const
static EXPORT const OTString & AppDataFolder()
EXPORT void Format(const char *fmt,...)
static EXPORT bool AppendFolder(OTString &out_strPath, const OTString &strBasePath, const OTString &strFolderName)
bool GetCurrentWorking(OTString &strCurrentWorkingPath)
static EXPORT bool FixPath(const OTString &strPath, OTString &out_strFixedPath, const bool &bIsFolder)
EXPORT bool Compare(const char *compare) const
static EXPORT bool Get(OTSettings &config, const OTString &strSection, const OTString &strKey, OTString &out_strVar, bool &out_bIsRelative, bool &out_bKeyExist)
EXPORT void Set(const char *data, uint32_t enforcedMaxLength=0)
static EXPORT bool GetHomeFromSystem(OTString &out_strHomeFolder)
static EXPORT void SetHomeFolder(OTString strLocation)
static EXPORT bool IsInitialized()
EXPORT bool Set_str(const OTString &strSection, const OTString &strKey, const OTString &strValue, bool &out_bNewOrUpdate, const OTString &strComment="")
#define OT_ASSERT_MSG(x, s)
static EXPORT bool BuildFilePath(const OTString &strFolderPath, bool &out_bFolderCreated)
static EXPORT bool LoadSetScriptsFolder(OTSettings &config=s_settings, const OTString &strScriptsFolder="", const bool &bIsRelative=true)
#define OT_INIT_CONFIG_FILENAME
EXPORT std::string UTF8FromUTF16(const std::wstring &utf16)
static EXPORT bool ConfirmCreateFolder(const OTString &strExactPath, bool &out_Exists, bool &out_IsNew)
EXPORT bool Check_bool(const OTString &strSection, const OTString &strKey, bool &out_bResult, bool &out_bKeyExist) const
OTLOG_IMPORT OTLogStream otWarn
EXPORT const char * Get() const
OTLOG_IMPORT OTLogStream otErr
static EXPORT const OTString & ScriptsFolder()
EXPORT bool Exists(std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
EXPORT const bool & IsLoaded() const
static EXPORT const OTString & AppBinaryFolder()
static EXPORT bool AppendFile(OTString &out_strPath, const OTString &strBasePath, const OTString &strFileName)
bool GetExecutable(OTString &strExecutablePath)
static EXPORT bool FolderExists(const OTString &strFolderPath)
static EXPORT const OTString & HomeFolder()
static EXPORT bool PathExists(const OTString &strPath)
static EXPORT const OTString & GlobalConfigFile()
static EXPORT std::string replace_chars(const std::string &str, const std::string &charsFrom, const char &charTo)