File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -25,3 +25,14 @@ fs::path GetWalletDir()
2525
2626 return path;
2727}
28+
29+ WalletLocation::WalletLocation (const std::string& name)
30+ : m_name(name)
31+ , m_path(fs::absolute(name, GetWalletDir()))
32+ {
33+ }
34+
35+ bool WalletLocation::Exists () const
36+ {
37+ return fs::symlink_status (m_path).type () != fs::file_not_found;
38+ }
Original file line number Diff line number Diff line change 1111// ! Get the path of the wallet directory.
1212fs::path GetWalletDir ();
1313
14+ // ! The WalletLocation class provides wallet information.
15+ class WalletLocation final
16+ {
17+ std::string m_name;
18+ fs::path m_path;
19+
20+ public:
21+ explicit WalletLocation () {}
22+ explicit WalletLocation (const std::string& name);
23+
24+ // ! Get wallet name.
25+ const std::string& GetName () const { return m_name; }
26+
27+ // ! Get wallet absolute path.
28+ const fs::path& GetPath () const { return m_path; }
29+
30+ // ! Return whether the wallet exists.
31+ bool Exists () const ;
32+ };
33+
1434#endif // BITCOIN_WALLET_WALLETUTIL_H
You can’t perform that action at this time.
0 commit comments