Changeset View
Changeset View
Standalone View
Standalone View
src/util/system.cpp
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | |||||
#include <shellapi.h> | #include <shellapi.h> | ||||
#include <shlobj.h> | #include <shlobj.h> | ||||
#endif | #endif | ||||
#ifdef HAVE_MALLOPT_ARENA_MAX | #ifdef HAVE_MALLOPT_ARENA_MAX | ||||
#include <malloc.h> | #include <malloc.h> | ||||
#endif | #endif | ||||
#include <boost/algorithm/string/replace.hpp> | |||||
// Application startup time (used for uptime calculation) | // Application startup time (used for uptime calculation) | ||||
const int64_t nStartupTime = GetTime(); | const int64_t nStartupTime = GetTime(); | ||||
const char *const BITCOIN_CONF_FILENAME = "bitcoin.conf"; | const char *const BITCOIN_CONF_FILENAME = "bitcoin.conf"; | ||||
const char *const BITCOIN_SETTINGS_FILENAME = "settings.json"; | const char *const BITCOIN_SETTINGS_FILENAME = "settings.json"; | ||||
ArgsManager gArgs; | ArgsManager gArgs; | ||||
▲ Show 20 Lines • Show All 1,183 Lines • ▼ Show 20 Lines | fs::path GetSpecialFolderPath(int nFolder, bool fCreate) { | ||||
} | } | ||||
LogPrintf( | LogPrintf( | ||||
"SHGetSpecialFolderPathW() failed, could not obtain requested path.\n"); | "SHGetSpecialFolderPathW() failed, could not obtain requested path.\n"); | ||||
return fs::path(""); | return fs::path(""); | ||||
} | } | ||||
#endif | #endif | ||||
#ifndef WIN32 | |||||
std::string ShellEscape(const std::string &arg) { | |||||
std::string escaped = arg; | |||||
boost::replace_all(escaped, "'", "'\"'\"'"); | |||||
return "'" + escaped + "'"; | |||||
} | |||||
#endif | |||||
#if defined(HAVE_SYSTEM) | #if defined(HAVE_SYSTEM) | ||||
void runCommand(const std::string &strCommand) { | void runCommand(const std::string &strCommand) { | ||||
if (strCommand.empty()) { | if (strCommand.empty()) { | ||||
return; | return; | ||||
} | } | ||||
#ifndef WIN32 | #ifndef WIN32 | ||||
int nErr = ::system(strCommand.c_str()); | int nErr = ::system(strCommand.c_str()); | ||||
#else | #else | ||||
▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines |