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>

class path
    : public std::filesystem::path

Base Classes

Name

Description

std::filesystem::path

Types

Name

iterator

Type Aliases

Enums

Name

format

Member Functions

Name

Description

path [constructor]

Constructors

operator=

Assignment operators

__reserve

append

append overloads

assign

begin

c_str

clear

compare

concat

empty

end

extension

filename

generic_string

generic_u16string

generic_u32string

generic_u8string

generic_wstring

has_extension

has_filename

has_parent_path

has_relative_path

has_root_directory

has_root_name

has_root_path

has_stem

is_absolute

is_relative

lexically_normal

lexically_proximate

lexically_relative

make_preferred

native

operator+=

Addition assignment operators

operator/=

Division assignment operators

parent_path

relative_path

remove_filename

replace_extension

replace_filename

root_directory

root_name

root_path

std_path

std_path overloads

stem

string

Deleted to forbid std::string conversion, which encodes locale‐dependently on Windows.

swap

u16string

u32string

u8string

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.

wstring

operator string_type [deleted]

Deleted to forbid implicit string_type conversion, whose type varies by platform and breaks portability.

Static Data Members

Using Declarations

Name

Description

path

Inherit the std::filesystem::path constructors.

Non-Member Functions

Name

Description

operator+

Deleted catch‐all overload that forbids unsafe path concatenation via operator+.

operator/

Deleted catch‐all overload that forbids unsafe path append operations via operator/.

::AbsPathForConfigVal

Most paths passed as configuration arguments are treated as relative to the datadir if they are not absolute.

::BlockPolicyFeeEstPath

Path of the block policy fee estimator data file.

::CheckDiskSpace

Check that a directory has enough free space for an additional write.

::DecodeAsmap

Read and check asmap from provided binary file.

::DirectoryCommit

Sync directory contents. This is required on some environments to ensure that newly created files are committed to disk.

::DumpAnchors

Dump the anchor IP address database (anchors.dat)

::GetDefaultDataDir

Get the default data directory for the current platform and user.

::IsDirWritable

Check if a directory is writable by creating a temporary file on it.

::MempoolPolicyEstimatorPath

Path of the mempool policy estimator data file.

::ReadAnchors

Read the anchor IP address database (anchors.dat)

::ReadBinaryFile

Read full contents of a file and return them in a std::string.

::RenameOver

Rename src to dest.

::TryCreateDirectories

Create a directory and any missing parent directories.

::UnlockDirectory

Release a directory lock previously taken with LockDirectory.

::WriteBinaryFile

Write contents of std::string to a file.

::common::ReadSettings

Read settings file.

::common::WriteSettings

Write settings file.

::fsbridge::AbsPathJoin

Helper function for joining two paths

::fsbridge::fopen

Open a file, handling path encoding correctly across platforms.

::node::FindAssumeutxoChainstateDir

Return a path to the snapshot‐based chainstate dir, if one exists.

::node::MempoolPath

Return the on‐disk path used to load and save the persisted mempool.

::node::ReadSnapshotBaseBlockhash

Read the blockhash of the snapshot base block that was used to construct the chainstate.

::util::GetExePath

Return path to current executable assuming it was invoked with argv0. If path could not be determined, returns an empty path.

::util::LockDirectory

Acquire an exclusive lock on a directory via a lock file.

::wallet::BDBDataFile

Returns the path to the Berkeley DB data file for a wallet path.

::wallet::GetWalletDir

Get the path of the wallet directory.

::wallet::GetWalletPath

Determine the path that the wallet is stored in

::wallet::IsBDBFile

Returns whether the file at the path is a Berkeley DB file.

::wallet::IsSQLiteFile

Returns whether the file at the path is a SQLite file.

::wallet::ListDatabases

Recursively list database paths in directory.

::wallet::MakeBerkeleyRODatabase

Return object giving access to Berkeley Read Only database at specified path.

::wallet::MakeDatabase

Creates or opens a wallet database at the given path.

::wallet::MakeSQLiteDatabase

Open or create a SQLite wallet database at the given path.

::wallet::SQLiteDataFile

Returns the path to the SQLite data file for a wallet path.

Created with MrDocs