xentara-plugin v2.0.4
The Xentara Plugin Framework
Loading...
Searching...
No Matches
xentara::config::Context::ExternalConfigPath Class Referencefinal

A file path used to find an external config file or directory. More...

#include <xentara/config/Context.hpp>

Public Member Functions

 ExternalConfigPath (utils::json::decoder::Value &value)
 Constructor for a path contained in a JSON value.
 
 ExternalConfigPath (const std::filesystem::path &path, const utils::json::decoder::Location &location)
 Constructor for an arbitrary path.
 
 ExternalConfigPath (std::filesystem::path &&path, const utils::json::decoder::Location &location)
 Constructor for an arbitrary path.
 

Detailed Description

A file path used to find an external config file or directory.

Constructor & Destructor Documentation

◆ ExternalConfigPath() [1/3]

xentara::config::Context::ExternalConfigPath::ExternalConfigPath ( utils::json::decoder::Value value)

Constructor for a path contained in a JSON value.

This constructor is used to find a file or directory using a path contained in a JSON value. The path is read from the value using Value::asString().

Parameters
valueThe JSON value containing the primary path of the object to resolve
Exceptions
utils::json::decoder::TypeMismatchErrorpath is not a string value
std::runtime_errorAn error occurred reading the path from the JSON document

◆ ExternalConfigPath() [2/3]

xentara::config::Context::ExternalConfigPath::ExternalConfigPath ( const std::filesystem::path path,
const utils::json::decoder::Location location 
)

Constructor for an arbitrary path.

This constructor is used to find a file or directory using an arbitrary path.

Parameters
pathThe path to search for
locationThe location within the JSON document that the path is associated with. This is used to output the line number in error messages. The location can be a location of a value the path is derived from, or any location that helps the user find the error in the JSON document in case the file or directory cannot be resolved.
Exceptions
utils::json::decoder::TypeMismatchErrorpath is not a string value
std::runtime_errorAn error occurred reading the path from the JSON document

◆ ExternalConfigPath() [3/3]

xentara::config::Context::ExternalConfigPath::ExternalConfigPath ( std::filesystem::path &&  path,
const utils::json::decoder::Location location 
)

Constructor for an arbitrary path.

This constructor is used to find a file or directory using an arbitrary path.

Parameters
pathThe path to search for
locationThe location within the JSON document that the path is associated with. This is used to output the line number in error messages. The location can be a location of a value the path is derived from, or any location that helps the user find the error in the JSON document in case the file or directory cannot be resolved.
Exceptions
utils::json::decoder::TypeMismatchErrorpath is not a string value
std::runtime_errorAn error occurred reading the path from the JSON document