diff options
author | João Barbosa <joao.paulo.barbosa@gmail.com> | 2018-09-28 12:50:04 +0100 |
---|---|---|
committer | João Barbosa <joao.paulo.barbosa@gmail.com> | 2018-10-25 11:53:17 +0100 |
commit | 01a4c095c87500650663341533f000c6b613e9da (patch) | |
tree | b559b0826ae96da3b93c12b5940e14cb6ea2d4b0 /src/wallet/walletutil.h | |
parent | 613fc95ee4ead5962e960137e694aec5888e2680 (diff) |
wallet: Add WalletLocation utility class
Diffstat (limited to 'src/wallet/walletutil.h')
-rw-r--r-- | src/wallet/walletutil.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/wallet/walletutil.h b/src/wallet/walletutil.h index 77f5ca428d..ba2f913841 100644 --- a/src/wallet/walletutil.h +++ b/src/wallet/walletutil.h @@ -15,4 +15,24 @@ fs::path GetWalletDir(); //! Get wallets in wallet directory. std::vector<fs::path> ListWalletDir(); +//! The WalletLocation class provides wallet information. +class WalletLocation final +{ + std::string m_name; + fs::path m_path; + +public: + explicit WalletLocation() {} + explicit WalletLocation(const std::string& name); + + //! Get wallet name. + const std::string& GetName() const { return m_name; } + + //! Get wallet absolute path. + const fs::path& GetPath() const { return m_path; } + + //! Return whether the wallet exists. + bool Exists() const; +}; + #endif // BITCOIN_WALLET_WALLETUTIL_H |