Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
util.h
Go to the documentation of this file.
179 std::string message = tinyformat::format("\n****TINYFORMAT ERROR****\n err=\"%s\"\n fmt=\"%s\"\n", fmterr.what(), fmt);
186 template<typename... Args> std::string FormatStringFromLogArgs(const char *fmt, const Args&... args) { return fmt; }
189 template<typename T, typename... Args> static inline void MarkUsed(const T& t, const Args&... args)
209 _log_msg_ = "Error \"" + std::string(e.what()) + "\" while formatting log message: " + FormatStringFromLogArgs(__VA_ARGS__); \
234 bool LockDirectory(const fs::path& directory, const std::string lockfile_name, bool probe_only=false);
457 std::string CopyrightHolders(const std::string& strPrefix, unsigned int nStartYear, unsigned int nEndYear);
Definition: util.h:124
Definition: util.h:147
bool IsArgSet(const std::string &strArg) const
Return true if the given argument has been manually set.
Definition: util.cpp:784
Definition: util.h:138
Definition: util.h:114
Definition: util.h:110
void ParseParameters(int argc, const char *const argv[])
Definition: util.cpp:730
Definition: util.h:116
bool SoftSetBoolArg(const std::string &strArg, bool fValue)
Set a boolean argument if it doesn't already have a value.
Definition: util.cpp:840
Definition: util.h:139
Definition: util.h:107
bool GetLogCategory(uint64_t *f, const std::string *str)
Return true if str parses as a log category and set the flags in f.
Definition: util.cpp:291
Definition: util.h:128
Definition: util.h:123
Definition: util.h:120
Definition: util.h:118
void WarnForSectionOnlyArgs()
Log warnings for options in m_section_only_args when they are specified in the default section but no...
Definition: util.cpp:697
std::string SafeIntVersionToString(uint32_t nVersion)
Copy of the IntVersionToString, that returns "Invalid version" string instead of throwing std::bad_ca...
Definition: util.cpp:1415
Definition: util.h:117
bool LockDirectory(const fs::path &directory, const std::string lockfile_name, bool probe_only=false)
Definition: util.cpp:477
Definition: util.h:278
std::vector< CLogCategoryActive > ListActiveLogCategories()
Returns a vector of the active log categories.
Definition: util.cpp:337
int nWalletBackups
nWalletBackups: 1..10 - number of automatic backups to keep 0 - disabled by command-line -1 - disable...
Definition: util.cpp:102
void SelectConfigNetwork(const std::string &network)
Select the network in use.
Definition: util.cpp:725
Definition: util.h:119
bool GetBoolArg(const std::string &strArg, bool fDefault) const
Return boolean argument or default value.
Definition: util.cpp:824
Definition: util.h:141
std::map< std::string, std::vector< std::string > > m_config_args
Definition: util.h:285
void ForceSetArg(const std::string &strArg, const std::string &strValue)
Definition: util.cpp:848
Definition: util.h:143
std::string HelpMessageGroup(const std::string &message)
Format a string to be used as group of options in help messages.
Definition: util.cpp:880
Definition: util.h:130
void ReadConfigFile(const std::string &confPath)
Definition: util.cpp:1000
bool SoftSetArg(const std::string &strArg, const std::string &strValue)
Set an argument if it doesn't already have a value.
Definition: util.cpp:832
Definition: util.h:127
Definition: util.h:129
Definition: util.h:125
uint32_t StringVersionToInt(const std::string &strVersion)
Converts version strings to 4-byte unsigned integer.
Definition: util.cpp:1379
Definition: util.h:101
std::string CopyrightHolders(const std::string &strPrefix, unsigned int nStartYear, unsigned int nEndYear)
Definition: util.cpp:1364
void RenameThreadPool(ctpl::thread_pool &tp, const char *baseName)
Definition: util.cpp:1276
bool TryCreateDirectories(const fs::path &p)
Ignores exceptions thrown by Boost's create_directories if the requested directory exists...
Definition: util.cpp:1085
Definition: util.h:122
Definition: util.h:137
Definition: util.h:111
bool IsArgNegated(const std::string &strArg) const
Return true if the argument was originally passed as a negated option, i.e.
Definition: util.cpp:790
void PrintExceptionContinue(const std::exception_ptr pex, const char *pszExceptionOrigin)
Definition: util.cpp:891
std::atomic< uint64_t > logCategories
Definition: util.h:142
void format(std::ostream &out, const char *fmt, const Args &... args)
Format list of arguments to the stream according to given format string.
Definition: tinyformat.h:967
Definition: util.h:134
Definition: util.h:109
int GetNumCores()
Return the number of physical cores available on the current system.
Definition: util.cpp:1355
Definition: util.h:126
Definition: util.h:149
std::string ListActiveLogCategoriesString()
Returns a string with the list of active log categories.
Definition: util.cpp:352
std::string GetDevNetName() const
Looks for -devnet and returns either "devnet-<name>" or simply "devnet" if no name was specified...
Definition: util.cpp:1045
Definition: util.h:121
std::unique_ptr< T > MakeUnique(Args &&... args)
Substitute for C++14 std::make_unique.
Definition: util.h:489
Definition: util.h:140
std::atomic< bool > fReopenDebugLog
Definition: util.h:112
boost::signals2::signal< std::string(const char *psz)> Translate
Translate a message to the native language of the user.
Definition: util.h:70
std::string GetArg(const std::string &strArg, const std::string &strDefault) const
Return string argument or default value.
Definition: util.cpp:808
Definition: util.h:133
Definition: util.h:135
std::string IntVersionToString(uint32_t nVersion)
Converts version as 4-byte unsigned integer to string.
Definition: util.cpp:1399
int RaiseFileDescriptorLimit(int nMinFD)
this function tries to raise the file descriptor limit to the requested number.
Definition: util.cpp:1128
std::string GetChainName() const
Looks for -regtest, -testnet and returns the appropriate BIP70 chain name.
Definition: util.cpp:1026
Definition: ctpl.h:48
void AllocateFileRange(FILE *file, unsigned int offset, unsigned int length)
this function tries to make a particular range of a file allocated (corresponding to disk space) it i...
Definition: util.cpp:1151
Definition: util.h:113
std::vector< std::string > GetArgs(const std::string &strArg) const
Return a vector of strings of the given argument.
Definition: util.cpp:765
Definition: util.h:144
std::string SafeStringFormat(const std::string &fmt, const Args &... args)
Formats a string without throwing exceptions.
Definition: util.h:174
Definition: util.h:115
Definition: util.h:136
fs::path AbsPathForConfigVal(const fs::path &path, bool net_specific=true)
Most paths passed as configuration arguments are treated as relative to the datadir if they are not a...
Definition: util.cpp:1434
std::string HelpMessageOpt(const std::string &option, const std::string &message)
Format a string to be used as option description in help messages.
Definition: util.cpp:884
std::string FormatStringFromLogArgs(const char *fmt, const Args &... args)
Get format string from VA_ARGS for error reporting.
Definition: util.h:186
std::map< std::string, std::vector< std::string > > m_override_args
Definition: util.h:284
std::string _(const char *psz)
Translation function: Call Translate signal on UI interface, which returns a boost::optional result...
Definition: util.h:92
Wrapped mutex: supports recursive locking, but no waiting TODO: We should move away from using the re...
Definition: sync.h:94