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 @@ -75,3 +75,14 @@ std::vector<fs::path> ListWalletDir()
75
75
76
76
return paths;
77
77
}
78
+
79
+ WalletLocation::WalletLocation (const std::string& name)
80
+ : m_name(name)
81
+ , m_path(fs::absolute(name, GetWalletDir()))
82
+ {
83
+ }
84
+
85
+ bool WalletLocation::Exists () const
86
+ {
87
+ return fs::symlink_status (m_path).type () != fs::file_not_found;
88
+ }
Original file line number Diff line number Diff line change @@ -15,4 +15,24 @@ fs::path GetWalletDir();
15
15
// ! Get wallets in wallet directory.
16
16
std::vector<fs::path> ListWalletDir ();
17
17
18
+ // ! The WalletLocation class provides wallet information.
19
+ class WalletLocation final
20
+ {
21
+ std::string m_name;
22
+ fs::path m_path;
23
+
24
+ public:
25
+ explicit WalletLocation () {}
26
+ explicit WalletLocation (const std::string& name);
27
+
28
+ // ! Get wallet name.
29
+ const std::string& GetName () const { return m_name; }
30
+
31
+ // ! Get wallet absolute path.
32
+ const fs::path& GetPath () const { return m_path; }
33
+
34
+ // ! Return whether the wallet exists.
35
+ bool Exists () const ;
36
+ };
37
+
18
38
#endif // BITCOIN_WALLET_WALLETUTIL_H
You can’t perform that action at this time.
0 commit comments