35 namespace filesystem {
62 DECLARE_EXCEPTION( ExcFileOpen, <<
"Can not open file: " << EI_Path::qval <<
"\nAt input address: " << EI_Address_String::qval );
63 DECLARE_EXCEPTION( ExcAbsOutputPath, <<
"Can not set absolute path " << EI_Path::qval <<
" for an output file." );
88 FilePath(
string file_path,
const FileType ft);
107 static void set_io_dirs(
const string working_dir,
const string root,
const string input,
const string output);
117 static void set_dirs(
const string root,
const string input,
const string output);
129 static string set_dirs_from_input(
const string main_yaml,
const string input,
const string output);
134 operator string()
const;
150 static void add_placeholder(
string key,
string value);
155 static const string get_absolute_working_dir();
165 void create_output_dir();
170 string parent_path()
const;
175 string filename()
const;
185 string extension()
const;
190 string cut_extension()
const;
197 template <
class Stream>
198 void open_stream(Stream &stream)
const;
209 static void create_dir(
const boost::filesystem::path &dir);
214 void substitute_value(
string &path);
223 static string convert_for_check_absolute(
string path);
239 static std::shared_ptr<boost::filesystem::path>
root_dir;
Dedicated class for storing path to input and output files.
FileType
Possible types of file.
DECLARE_EXCEPTION(ExcMkdirFail,<< "Can not create directory: "<< EI_Path::qval)
std::shared_ptr< boost::filesystem::path > abs_file_path_
Final absolute path to the file.
static std::shared_ptr< boost::filesystem::path > root_dir
Prefix path for input files (directory of the main input file).
static std::map< string, string > placeholder
dictionary of placeholders
static std::shared_ptr< boost::filesystem::path > output_dir
Prefix path for output files.
DECLARE_EXCEPTION(ExcFileOpen,<< "Can not open file: "<< EI_Path::qval<< "\nAt input address: "<< EI_Address_String::qval)
TYPEDEF_ERR_INFO(EI_Path, string)
DECLARE_EXCEPTION(ExcAbsOutputPath,<< "Can not set absolute path "<< EI_Path::qval<< " for an output file.")
TYPEDEF_ERR_INFO(EI_Address_String, string)
FileType file_type_
File type.
std::ostream & operator<<(std::ostream &stream, const FilePath &fp)
Allow redirect FilePath to stream.
static constexpr bool value
bool operator==(const Null &, const Null &)