From 540ca5111f7dc91a9808e41ccb4446d8dc0a1bec Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Fri, 4 Feb 2022 17:57:51 +0200 Subject: util: Add ArgsManager::GetPathArg() function Co-authored-by: Ryan Ofsky --- src/util/system.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/util/system.h') diff --git a/src/util/system.h b/src/util/system.h index a8fd21fcaa..6b7bd38cc2 100644 --- a/src/util/system.h +++ b/src/util/system.h @@ -264,6 +264,16 @@ protected: */ std::optional GetCommand() const; + /** + * Get a normalized path from a specified pathlike argument + * + * It is guaranteed that the returned path has no trailing slashes. + * + * @param pathlike_arg Pathlike argument to get a path from (e.g., "-datadir", "-blocksdir" or "-walletdir") + * @return Normalized path which is get from a specified pathlike argument + */ + fs::path GetPathArg(std::string pathlike_arg) const; + /** * Get blocks directory path * -- cgit v1.2.3