aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/walletutil.h
diff options
context:
space:
mode:
authorJoão Barbosa <joao.paulo.barbosa@gmail.com>2018-09-28 12:50:04 +0100
committerJoão Barbosa <joao.paulo.barbosa@gmail.com>2019-03-11 21:54:44 +0000
commit21693ff0b743f094e73111a81c1c86e2622d937c (patch)
tree9b85620bce2b92692d56426aaf57db3ae2e10fa3 /src/wallet/walletutil.h
parent1c98a758d0f43f12d600731373758303cefe7cd7 (diff)
downloadbitcoin-21693ff0b743f094e73111a81c1c86e2622d937c.tar.xz
wallet: Add WalletLocation utility class
Github-Pull: #14350 Rebased-From: 01a4c09
Diffstat (limited to 'src/wallet/walletutil.h')
-rw-r--r--src/wallet/walletutil.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/wallet/walletutil.h b/src/wallet/walletutil.h
index 7c42954616..a8cd7b6180 100644
--- a/src/wallet/walletutil.h
+++ b/src/wallet/walletutil.h
@@ -11,4 +11,24 @@
//! Get the path of the wallet directory.
fs::path GetWalletDir();
+//! 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