Fcitx
Public Member Functions | Static Public Member Functions | List of all members
fcitx::StandardPaths Class Reference

Public Member Functions

 StandardPaths (const std::string &packageName, const std::unordered_map< std::string, std::vector< std::filesystem::path >> &builtInPath, StandardPathsOptions options)
 Allow to construct a StandardPath with customized internal value. More...
 
const std::filesystem::path & userDirectory (StandardPathsType type) const
 Get user writable directory for given type. More...
 
std::span< const std::filesystem::path > directories (StandardPathsType type, StandardPathsModes modes=StandardPathsMode::Default) const
 Get all directories in the order of priority.
 
std::filesystem::path locate (StandardPathsType type, const std::filesystem::path &path, StandardPathsModes modes=StandardPathsMode::Default) const
 Check if a file exists. More...
 
std::vector< std::filesystem::path > locateAll (StandardPathsType type, const std::filesystem::path &path, StandardPathsModes modes=StandardPathsMode::Default) const
 Check if path exists in all directories. More...
 
std::map< std::filesystem::path, std::filesystem::path > locate (StandardPathsType type, const std::filesystem::path &path, const StandardPathsFilterCallback &callback, StandardPathsModes modes=StandardPathsMode::Default) const
 All subpath under path with filter. More...
 
UnixFD open (StandardPathsType type, const std::filesystem::path &path, StandardPathsModes modes=StandardPathsMode::Default, std::filesystem::path *outPath=nullptr) const
 Open the first matched and succeeded file for read. More...
 
std::vector< UnixFDopenAll (StandardPathsType type, const std::filesystem::path &path, StandardPathsModes modes=StandardPathsMode::Default, std::vector< std::filesystem::path > *outPath=nullptr) const
 Open the all matched and file for read.
 
bool safeSave (StandardPathsType type, const std::filesystem::path &pathOrig, const std::function< bool(int)> &callback) const
 Save the file safely with write and rename to make sure the operation is atomic. More...
 
int64_t timestamp (StandardPathsType type, const std::filesystem::path &path, StandardPathsModes modes=StandardPathsMode::Default) const
 
void syncUmask () const
 Sync system umask to internal state. More...
 
bool skipBuiltInPath () const
 Whether this StandardPath is configured to Skip built-in path. More...
 
bool skipUserPath () const
 Whether this StandardPath is configured to Skip user path.
 
bool skipSystemPath () const
 Whether this StandardPath is configured to Skip system path.
 
StandardPathsOptions options () const
 Get the options for the StandardPaths. More...
 

Static Public Member Functions

static const StandardPathsglobal ()
 Return the global instance of StandardPath.
 
static std::filesystem::path fcitxPath (const char *path, const std::filesystem::path &subPath={})
 Return fcitx specific path defined at compile time. More...
 
static std::filesystem::path findExecutable (const std::filesystem::path &name)
 
static bool hasExecutable (const std::filesystem::path &name)
 
static UnixFD openPath (const std::filesystem::path &path, std::optional< int > flags=std::nullopt, std::optional< mode_t > mode=std::nullopt)
 Open the path. More...
 

Detailed Description

Definition at line 85 of file standardpaths.h.


The documentation for this class was generated from the following files: