Add AbsPathForConfigVal to consolidate datadir prefixing for path args

Most commandline/config args are interpreted as relative to datadir if
not passed absolute. Consolidate the logic for this normalization.
This commit is contained in:
James O'Beirne
2018-01-30 22:33:49 -05:00
parent a1e13055c2
commit 54604600c3
3 changed files with 20 additions and 16 deletions

View File

@@ -191,6 +191,16 @@ bool OpenDebugLog();
void ShrinkDebugFile();
void runCommand(const std::string& strCommand);
/**
* Most paths passed as configuration arguments are treated as relative to
* the datadir if they are not absolute.
*
* @param path The path to be conditionally prefixed with datadir.
* @param net_specific Forwarded to GetDataDir().
* @return The normalized path.
*/
fs::path AbsPathForConfigVal(const fs::path& path, bool net_specific = true);
inline bool IsSwitchChar(char c)
{
#ifdef WIN32