[#fs-path] = xref:fs.adoc[fs]::path :relfileprefix: ../ :mrdocs: Path class wrapper to block calls to the fs::path(std::string) implicit constructor and the fs::path::string() method, which have unsafe and unpredictable behavior on Windows (see implementation note in PathToString for details) == Synopsis Declared in `<util/fs.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class path : public std::filesystem::path ---- == Base Classes [cols="1,4"] |=== | Name| Description | `std::filesystem::path` | |=== == Types [cols="1"] |=== | Name | xref:fs/path/iterator.adoc[`iterator`] |=== == Type Aliases [cols="1"] |=== | Name | xref:fs/path/__string_view.adoc[`__string_view`] | xref:fs/path/const_iterator.adoc[`const_iterator`] | xref:fs/path/string_type.adoc[`string_type`] | xref:fs/path/value_type.adoc[`value_type`] |=== == Enums [cols="1"] |=== | Name | xref:fs/path/format.adoc[`format`] |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:fs/path/2constructor-066.adoc[`path`] [.small]#[constructor]# | Constructors | xref:fs/path/operator_assign-0b.adoc[`operator=`] | Assignment operators | xref:fs/path/__reserve.adoc[`__reserve`] | | xref:fs/path/append-09.adoc[`append`] | `append` overloads | xref:fs/path/assign-03.adoc[`assign`] | | xref:fs/path/begin.adoc[`begin`] | | xref:fs/path/c_str.adoc[`c_str`] | | xref:fs/path/clear.adoc[`clear`] | | xref:fs/path/compare-00.adoc[`compare`] | | xref:fs/path/concat-08.adoc[`concat`] | | xref:fs/path/empty.adoc[`empty`] | | xref:fs/path/end.adoc[`end`] | | xref:fs/path/extension.adoc[`extension`] | | xref:fs/path/filename.adoc[`filename`] | | xref:fs/path/generic_string-04.adoc[`generic_string`] | | xref:fs/path/generic_u16string.adoc[`generic_u16string`] | | xref:fs/path/generic_u32string.adoc[`generic_u32string`] | | xref:fs/path/generic_u8string.adoc[`generic_u8string`] | | xref:fs/path/generic_wstring.adoc[`generic_wstring`] | | xref:fs/path/has_extension.adoc[`has_extension`] | | xref:fs/path/has_filename.adoc[`has_filename`] | | xref:fs/path/has_parent_path.adoc[`has_parent_path`] | | xref:fs/path/has_relative_path.adoc[`has_relative_path`] | | xref:fs/path/has_root_directory.adoc[`has_root_directory`] | | xref:fs/path/has_root_name.adoc[`has_root_name`] | | xref:fs/path/has_root_path.adoc[`has_root_path`] | | xref:fs/path/has_stem.adoc[`has_stem`] | | xref:fs/path/is_absolute.adoc[`is_absolute`] | | xref:fs/path/is_relative.adoc[`is_relative`] | | xref:fs/path/lexically_normal.adoc[`lexically_normal`] | | xref:fs/path/lexically_proximate.adoc[`lexically_proximate`] | | xref:fs/path/lexically_relative.adoc[`lexically_relative`] | | xref:fs/path/make_preferred.adoc[`make_preferred`] | | xref:fs/path/native.adoc[`native`] | | xref:fs/path/operator_plus_eq-0c.adoc[`operator+=`] | Addition assignment operators | xref:fs/path/operator_slash_eq-0c.adoc[`operator/=`] | Division assignment operators | xref:fs/path/parent_path.adoc[`parent_path`] | | xref:fs/path/relative_path.adoc[`relative_path`] | | xref:fs/path/remove_filename.adoc[`remove_filename`] | | xref:fs/path/replace_extension.adoc[`replace_extension`] | | xref:fs/path/replace_filename.adoc[`replace_filename`] | | xref:fs/path/root_directory.adoc[`root_directory`] | | xref:fs/path/root_name.adoc[`root_name`] | | xref:fs/path/root_path.adoc[`root_path`] | | xref:fs/path/std_path-04.adoc[`std_path`] | `std_path` overloads | xref:fs/path/stem.adoc[`stem`] | | xref:fs/path/string-0e.adoc[`string`] | Deleted to forbid std::string conversion, which encodes locale‐dependently on Windows. | xref:fs/path/swap.adoc[`swap`] | | xref:fs/path/u16string.adoc[`u16string`] | | xref:fs/path/u32string.adoc[`u32string`] | | xref:fs/path/u8string.adoc[`u8string`] | | xref:fs/path/utf8string.adoc[`utf8string`] | Return a UTF‐8 representation of the path as a std::string, for compatibility with code using std::string. For code using the newer std::u8string type, it is more efficient to call the inherited std::filesystem::path::u8string method instead. | xref:fs/path/wstring.adoc[`wstring`] | | xref:fs/path/2conversion.adoc[`operator string_type`] [.small]#[deleted]# | Deleted to forbid implicit string_type conversion, whose type varies by platform and breaks portability. |=== == Static Data Members [cols="1"] |=== | Name | xref:fs/path/preferred_separator.adoc[`preferred_separator`] |=== == Using Declarations [cols="1,4"] |=== | Name| Description | xref:fs/path/path.adoc[`path`] | Inherit the std::filesystem::path constructors. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:fs/operator_plus.adoc[`operator+`] | Deleted catch‐all overload that forbids unsafe path concatenation via operator+. | xref:fs/operator_slash.adoc[`operator/`] | Deleted catch‐all overload that forbids unsafe path append operations via operator/. | xref:AbsPathForConfigVal.adoc[`::AbsPathForConfigVal`] | Most paths passed as configuration arguments are treated as relative to the datadir if they are not absolute. | xref:BlockPolicyFeeEstPath.adoc[`::BlockPolicyFeeEstPath`] | Path of the block policy fee estimator data file. | xref:CheckDiskSpace.adoc[`::CheckDiskSpace`] | Check that a directory has enough free space for an additional write. | xref:DecodeAsmap.adoc[`::DecodeAsmap`] | Read and check asmap from provided binary file. | xref:DirectoryCommit.adoc[`::DirectoryCommit`] | Sync directory contents. This is required on some environments to ensure that newly created files are committed to disk. | xref:DumpAnchors.adoc[`::DumpAnchors`] | Dump the anchor IP address database (anchors.dat) | xref:GetDefaultDataDir.adoc[`::GetDefaultDataDir`] | Get the default data directory for the current platform and user. | xref:IsDirWritable.adoc[`::IsDirWritable`] | Check if a directory is writable by creating a temporary file on it. | xref:MempoolPolicyEstimatorPath.adoc[`::MempoolPolicyEstimatorPath`] | Path of the mempool policy estimator data file. | xref:ReadAnchors.adoc[`::ReadAnchors`] | Read the anchor IP address database (anchors.dat) | xref:ReadBinaryFile.adoc[`::ReadBinaryFile`] | Read full contents of a file and return them in a std::string. | xref:RenameOver.adoc[`::RenameOver`] | Rename src to dest. | xref:TryCreateDirectories.adoc[`::TryCreateDirectories`] | Create a directory and any missing parent directories. | xref:UnlockDirectory.adoc[`::UnlockDirectory`] | Release a directory lock previously taken with LockDirectory. | xref:WriteBinaryFile.adoc[`::WriteBinaryFile`] | Write contents of std::string to a file. | xref:common/ReadSettings.adoc[`::common::ReadSettings`] | Read settings file. | xref:common/WriteSettings.adoc[`::common::WriteSettings`] | Write settings file. | xref:fsbridge/AbsPathJoin.adoc[`::fsbridge::AbsPathJoin`] | Helper function for joining two paths | xref:fsbridge/fopen.adoc[`::fsbridge::fopen`] | Open a file, handling path encoding correctly across platforms. | xref:node/FindAssumeutxoChainstateDir.adoc[`::node::FindAssumeutxoChainstateDir`] | Return a path to the snapshot‐based chainstate dir, if one exists. | xref:node/MempoolPath.adoc[`::node::MempoolPath`] | Return the on‐disk path used to load and save the persisted mempool. | xref:node/ReadSnapshotBaseBlockhash.adoc[`::node::ReadSnapshotBaseBlockhash`] | Read the blockhash of the snapshot base block that was used to construct the chainstate. | xref:util/GetExePath.adoc[`::util::GetExePath`] | Return path to current executable assuming it was invoked with argv0. If path could not be determined, returns an empty path. | xref:util/LockDirectory.adoc[`::util::LockDirectory`] | Acquire an exclusive lock on a directory via a lock file. | xref:wallet/BDBDataFile.adoc[`::wallet::BDBDataFile`] | Returns the path to the Berkeley DB data file for a wallet path. | xref:wallet/GetWalletDir.adoc[`::wallet::GetWalletDir`] | Get the path of the wallet directory. | xref:wallet/GetWalletPath.adoc[`::wallet::GetWalletPath`] | Determine the path that the wallet is stored in | xref:wallet/IsBDBFile.adoc[`::wallet::IsBDBFile`] | Returns whether the file at the path is a Berkeley DB file. | xref:wallet/IsSQLiteFile.adoc[`::wallet::IsSQLiteFile`] | Returns whether the file at the path is a SQLite file. | xref:wallet/ListDatabases.adoc[`::wallet::ListDatabases`] | Recursively list database paths in directory. | xref:wallet/MakeBerkeleyRODatabase.adoc[`::wallet::MakeBerkeleyRODatabase`] | Return object giving access to Berkeley Read Only database at specified path. | xref:wallet/MakeDatabase.adoc[`::wallet::MakeDatabase`] | Creates or opens a wallet database at the given path. | xref:wallet/MakeSQLiteDatabase.adoc[`::wallet::MakeSQLiteDatabase`] | Open or create a SQLite wallet database at the given path. | xref:wallet/SQLiteDataFile.adoc[`::wallet::SQLiteDataFile`] | Returns the path to the SQLite data file for a wallet path. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#