|
NGen
|
Classes | |
| struct | DirectoryCloser |
Wrap closedir in a deleter to avoid GCC's ignored-attributes warning for decltype(&closedir) More... | |
Typedefs | |
| using | DirectoryPointer = std::unique_ptr<DIR, DirectoryCloser> |
| A self-closing pointer to a directory that may be operated upon. | |
| using | PlaceholderContext = std::vector<std::pair<std::string, std::string>> |
| A mapping of placeholder tokens to the values that should serve as their replacements. | |
Functions | |
| bool | is_regular_file_or_symlink_target (const std::string &path, const dirent *entry) |
| Test to see if a directory entry at a path is either a regular file or a symlink that points at a file. | |
| DirectoryPointer | open_directory (const std::string &path, const unsigned int wait_seconds=2, const unsigned int maximum_attempts=5) |
| Get a self-closing pointer to a directory. | |
| std::pair< std::regex, std::string > | create_file_pattern_matcher (std::string file_pattern, const PlaceholderContext &context) |
| Replace all placeholders in a given file pattern with a supplied context and return a prepared regular expression paired with its pattern. | |
| using anonymous_namespace{Formulation_Manager.cpp}::DirectoryPointer = std::unique_ptr<DIR, DirectoryCloser> |
A self-closing pointer to a directory that may be operated upon.
| using anonymous_namespace{Formulation_Manager.cpp}::PlaceholderContext = std::vector<std::pair<std::string, std::string>> |
A mapping of placeholder tokens to the values that should serve as their replacements.
| std::pair< std::regex, std::string > anonymous_namespace{Formulation_Manager.cpp}::create_file_pattern_matcher | ( | std::string | file_pattern, |
| const PlaceholderContext & | context ) |
Replace all placeholders in a given file pattern with a supplied context and return a prepared regular expression paired with its pattern.
TODO: Integrate with the path_tokens resolution functionality
| file_pattern | A configured pattern to match on when searching for a file |
| context | A set of placeholders and values that need to be inserted into the file pattern |
References create_file_pattern_matcher().
Referenced by create_file_pattern_matcher().
| bool anonymous_namespace{Formulation_Manager.cpp}::is_regular_file_or_symlink_target | ( | const std::string & | path, |
| const dirent * | entry ) |
Test to see if a directory entry at a path is either a regular file or a symlink that points at a file.
| path | The path to the directory containing the entry of interest |
| entry | The loaded/assigned directory entry |
| std::invalid_argument | if a null directory entry was passed |
| std::runtime_error | if the file could not be called with stat |
References is_regular_file_or_symlink_target().
Referenced by is_regular_file_or_symlink_target().
| DirectoryPointer anonymous_namespace{Formulation_Manager.cpp}::open_directory | ( | const std::string & | path, |
| const unsigned int | wait_seconds = 2, | ||
| const unsigned int | maximum_attempts = 5 ) |
Get a self-closing pointer to a directory.
| path | Where to look for a directory to open |
| wait_seconds | The number of seconds to wait between attempts to open the directory. Must be 1 or greater |
| maximum_attempts | The maximum number of times to get an open directory. Must be 1 or greater |
| std::invalid_argument | if the wait_seconds is less than 1 |
| std::invalid_argument | if the maximum_attempts is less than 1 |
| std::runtime_error | if an error occurred while attempting to read the directory |
| std::runtime_error | if the maximum_attempts was reached before successfully connecting to the directory |
References open_directory().
Referenced by open_directory().