29 namespace filesystem {
56 DECLARE_EXCEPTION( ExcFileOpen, <<
"Can not open file: " << EI_Path::qval <<
"\nAt input address: " << EI_Address_String::qval );
57 DECLARE_EXCEPTION( ExcAbsOutputPath, <<
"Can not set absolute path " << EI_Path::qval <<
" for an output file." );
58 DECLARE_EXCEPTION( ExcMkdirFail, <<
"Can not create directory: " << EI_Path::qval );
101 static void set_io_dirs(
const string working_dir,
const string root,
const string input,
const string output);
111 static void set_dirs(
const string root,
const string input,
const string output);
123 static string set_dirs_from_input(
const string main_yaml,
const string input,
const string output);
128 operator string()
const;
144 static void add_placeholder(
string key,
string value);
149 static const string get_absolute_working_dir();
159 void create_output_dir();
164 string parent_path()
const;
169 string filename()
const;
179 string extension()
const;
184 string cut_extension()
const;
191 template <
class Stream>
192 void open_stream(Stream &stream)
const;
203 static void create_dir(
const boost::filesystem::path &dir);
208 void substitute_value(
string &path);
217 static string convert_for_check_absolute(
string path);
233 static std::shared_ptr<boost::filesystem::path>
root_dir;
FileType
Possible types of file.
#define DECLARE_EXCEPTION(ExcName, Format)
Macro for simple definition of exceptions.
std::ostream & operator<<(std::ostream &stream, const FilePath &fp)
Allow redirect FilePath to stream.
static std::shared_ptr< boost::filesystem::path > root_dir
Prefix path for input files (directory of the main input file).
static constexpr bool value
bool operator==(const Null &, const Null &)
std::shared_ptr< boost::filesystem::path > abs_file_path_
Final absolute path to the file.
#define TYPEDEF_ERR_INFO(EI_Type, Type)
Macro to simplify declaration of error_info types.
Dedicated class for storing path to input and output files.
static std::map< string, string > placeholder
dictionary of placeholders
static std::shared_ptr< boost::filesystem::path > output_dir
Prefix path for output files.
FileType file_type_
File type.