Changeset View
Changeset View
Standalone View
Standalone View
src/util.h
Show All 9 Lines | |||||
#ifndef BITCOIN_UTIL_H | #ifndef BITCOIN_UTIL_H | ||||
#define BITCOIN_UTIL_H | #define BITCOIN_UTIL_H | ||||
#if defined(HAVE_CONFIG_H) | #if defined(HAVE_CONFIG_H) | ||||
#include "config/bitcoin-config.h" | #include "config/bitcoin-config.h" | ||||
#endif | #endif | ||||
#include "compat.h" | #include "compat.h" | ||||
#include "fs.h" | |||||
#include "tinyformat.h" | #include "tinyformat.h" | ||||
#include "utiltime.h" | #include "utiltime.h" | ||||
#include <atomic> | #include <atomic> | ||||
#include <cstdint> | #include <cstdint> | ||||
#include <exception> | #include <exception> | ||||
#include <map> | #include <map> | ||||
#include <string> | #include <string> | ||||
#include <vector> | #include <vector> | ||||
#include <boost/filesystem/path.hpp> | |||||
#include <boost/signals2/signal.hpp> | #include <boost/signals2/signal.hpp> | ||||
#include <boost/thread/exceptions.hpp> | #include <boost/thread/exceptions.hpp> | ||||
static const bool DEFAULT_LOGTIMEMICROS = false; | static const bool DEFAULT_LOGTIMEMICROS = false; | ||||
static const bool DEFAULT_LOGIPS = false; | static const bool DEFAULT_LOGIPS = false; | ||||
static const bool DEFAULT_LOGTIMESTAMPS = true; | static const bool DEFAULT_LOGTIMESTAMPS = true; | ||||
/** Signals for translation. */ | /** Signals for translation. */ | ||||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
void PrintExceptionContinue(const std::exception *pex, const char *pszThread); | void PrintExceptionContinue(const std::exception *pex, const char *pszThread); | ||||
void ParseParameters(int argc, const char *const argv[]); | void ParseParameters(int argc, const char *const argv[]); | ||||
void FileCommit(FILE *file); | void FileCommit(FILE *file); | ||||
bool TruncateFile(FILE *file, unsigned int length); | bool TruncateFile(FILE *file, unsigned int length); | ||||
int RaiseFileDescriptorLimit(int nMinFD); | int RaiseFileDescriptorLimit(int nMinFD); | ||||
void AllocateFileRange(FILE *file, unsigned int offset, unsigned int length); | void AllocateFileRange(FILE *file, unsigned int offset, unsigned int length); | ||||
bool RenameOver(boost::filesystem::path src, boost::filesystem::path dest); | bool RenameOver(fs::path src, fs::path dest); | ||||
bool TryCreateDirectory(const boost::filesystem::path &p); | bool TryCreateDirectory(const fs::path &p); | ||||
boost::filesystem::path GetDefaultDataDir(); | fs::path GetDefaultDataDir(); | ||||
const boost::filesystem::path &GetDataDir(bool fNetSpecific = true); | const fs::path &GetDataDir(bool fNetSpecific = true); | ||||
void ClearDatadirCache(); | void ClearDatadirCache(); | ||||
boost::filesystem::path GetConfigFile(const std::string &confPath); | fs::path GetConfigFile(const std::string &confPath); | ||||
#ifndef WIN32 | #ifndef WIN32 | ||||
boost::filesystem::path GetPidFile(); | fs::path GetPidFile(); | ||||
void CreatePidFile(const boost::filesystem::path &path, pid_t pid); | void CreatePidFile(const fs::path &path, pid_t pid); | ||||
#endif | #endif | ||||
void ReadConfigFile(const std::string &confPath); | void ReadConfigFile(const std::string &confPath); | ||||
#ifdef WIN32 | #ifdef WIN32 | ||||
boost::filesystem::path GetSpecialFolderPath(int nFolder, bool fCreate = true); | fs::path GetSpecialFolderPath(int nFolder, bool fCreate = true); | ||||
#endif | #endif | ||||
void OpenDebugLog(); | void OpenDebugLog(); | ||||
void ShrinkDebugFile(); | void ShrinkDebugFile(); | ||||
void runCommand(const std::string &strCommand); | void runCommand(const std::string &strCommand); | ||||
inline bool IsSwitchChar(char c) { | inline bool IsSwitchChar(char c) { | ||||
#ifdef WIN32 | #ifdef WIN32 | ||||
return c == '-' || c == '/'; | return c == '-' || c == '/'; | ||||
▲ Show 20 Lines • Show All 119 Lines • Show Last 20 Lines |