|
Flow123d
|
Dedicated class for storing path to input and output files. More...
#include <file_path.hh>

Public Types | |
| enum | FileType { input_file, output_file } |
| Possible types of file. More... | |
Public Member Functions | |
| TYPEDEF_ERR_INFO (EI_Path, string) | |
| DECLARE_EXCEPTION (ExcAbsOutputPath,<< "Can not set absolute path "<< EI_Path::qval<< "for an output file.") | |
| FilePath () | |
| FilePath (const string file_path, const FileType ft) | |
| operator string () const | |
Static Public Member Functions | |
| static void | set_io_dirs (const string working_dir, const string root_input, const string input, const string output) |
| static void | add_placeholder (string key, string value) |
| Add new item to place holder. More... | |
Private Member Functions | |
| void | substitute_value () |
Private Attributes | |
| string | abs_file_path |
| Final absolute path to the file. More... | |
Static Private Attributes | |
| static std::map< string, string > | placeholder |
| dictionary of placeholders More... | |
| static string | output_dir ="" |
| Prefix path for output files. More... | |
| static string | root_dir ="" |
| Prefix path for input files (directory of the main input file). More... | |
Dedicated class for storing path to input and output files.
FilePath objects are constructed from given absolute or relative path to the file and its type (input or output). Before you create any instance of the class you have to call static method set_io_dirs to set:
Definition at line 34 of file file_path.hh.
| enum FilePath::FileType |
Possible types of file.
| Enumerator | |
|---|---|
| input_file | |
| output_file | |
Definition at line 42 of file file_path.hh.
|
inline |
Default constructor, necessary when using Input::Record::opt_val() to initialize a FilePath.
Definition at line 50 of file file_path.hh.
| FilePath::FilePath | ( | const string | file_path, |
| const FileType | ft | ||
| ) |
Translates the given absolute or relative path to a file file_path depending on the file type ft.
For input files:
For output files:
Definition at line 17 of file file_path.cc.
|
static |
Add new item to place holder.
Placeholder is extended by adding a single new item. The item can be used in the name of the input or output file name. Currently, the only supported placeholder is ${INPUT}.
| [in] | key | Key of new item. |
| [in] | value | Value of new item. |
Definition at line 53 of file file_path.cc.

| FilePath::DECLARE_EXCEPTION | ( | ExcAbsOutputPath | , |
| << "Can not set absolute path "<< EI_Path::qval<< "for an output file." | |||
| ) |
|
inline |
This class is implicitly convertible to string.
Definition at line 77 of file file_path.hh.
|
static |
Set:
Definition at line 38 of file file_path.cc.

|
private |
Substitutes placeholders in abs_file_path.
Definition at line 58 of file file_path.cc.

| FilePath::TYPEDEF_ERR_INFO | ( | EI_Path | , |
| string | |||
| ) |
|
private |
Final absolute path to the file.
Definition at line 105 of file file_path.hh.
|
staticprivate |
Prefix path for output files.
Definition at line 111 of file file_path.hh.
|
staticprivate |
dictionary of placeholders
Definition at line 108 of file file_path.hh.
|
staticprivate |
Prefix path for input files (directory of the main input file).
Definition at line 114 of file file_path.hh.
1.8.4