Nix
2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Toggle main menu visibility
Loading...
Searching...
No Matches
executable-path.hh
Go to the documentation of this file.
1
#pragma once
3
4
#include "
nix/util/file-system.hh
"
5
6
namespace
nix {
7
8
MakeError(ExecutableLookupError,
Error
);
9
14
struct
ExecutablePath
15
{
16
std::vector<std::filesystem::path> directories;
17
18
constexpr
static
const
OsChar
separator =
19
#ifdef WIN32
20
L
';'
21
#else
22
':'
23
#endif
24
;
25
34
static
ExecutablePath
parse
(
const
OsString
& path);
35
40
void
parseAppend
(
const
OsString
& path);
41
45
static
ExecutablePath
load
();
46
50
OsString
render
()
const
;
51
69
std::optional<std::filesystem::path>
findName
(
70
const
OsString
& exe,
71
std::function<
bool
(
const
std::filesystem::path &)> isExecutableFile = isExecutableFileAmbient)
const
;
72
80
std::filesystem::path
findPath
(
81
const
std::filesystem::path & exe,
82
std::function<
bool
(
const
std::filesystem::path &)> isExecutable = isExecutableFileAmbient)
const
;
83
84
bool
operator==(
const
ExecutablePath
&)
const
=
default
;
85
};
86
87
}
// namespace nix
nix::Error
Definition
error.hh:310
file-system.hh
Utilities for working with the file system and file paths.
nix::OsChar
char OsChar
Definition
os-string.hh:21
nix::OsString
std::basic_string< OsChar > OsString
Definition
os-string.hh:36
nix::ExecutablePath
Definition
executable-path.hh:15
nix::ExecutablePath::parseAppend
void parseAppend(const OsString &path)
Definition
executable-path.cc:30
nix::ExecutablePath::load
static ExecutablePath load()
Definition
executable-path.cc:15
nix::ExecutablePath::render
OsString render() const
Definition
executable-path.cc:57
nix::ExecutablePath::parse
static ExecutablePath parse(const OsString &path)
Definition
executable-path.cc:23
nix::ExecutablePath::findPath
std::filesystem::path findPath(const std::filesystem::path &exe, std::function< bool(const std::filesystem::path &)> isExecutable=isExecutableFileAmbient) const
Definition
executable-path.cc:83
nix::ExecutablePath::findName
std::optional< std::filesystem::path > findName(const OsString &exe, std::function< bool(const std::filesystem::path &)> isExecutableFile=isExecutableFileAmbient) const
Definition
executable-path.cc:67
libutil
include
nix
util
executable-path.hh
Generated by
1.18.0