| 13 | namespace mdf { |
| 14 | |
| 15 | CsvWriter::CsvWriter(const std::string& filename) |
| 16 | : dest_filename_(filename) { |
| 17 | try { |
| 18 | path fullname(filename); |
| 19 | path parent_path = fullname.parent_path(); |
| 20 | parent_path_ = parent_path.string(); |
| 21 | name_ = fullname.filename().string(); |
| 22 | |
| 23 | path temp_path = temp_directory_path(); |
| 24 | temp_path.append(name_); |
| 25 | temp_filename_ = temp_path.string(); |
| 26 | |
| 27 | if (!exists(parent_path_)) { |
| 28 | create_directories(parent_path_); |
| 29 | } |
| 30 | |
| 31 | is_ok_ = true; |
| 32 | } catch (const std::exception& err) { |
| 33 | MDF_ERROR() << "CSV file path error. Error: " << err.what(); |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | CsvWriter::~CsvWriter() { |
| 38 | try { |