Skip to content
Snippets Groups Projects
Commit f69975db authored by Martin Beseda's avatar Martin Beseda
Browse files

[FIX] Removed dependency on C++ <filesystem> header, which was causing problems with portability.

parent a5096f0b
No related branches found
No related tags found
No related merge requests found
#include <string>
#include <fstream>
#include <sstream>
#include <experimental/filesystem>
#include <regex>
#include <algorithm>
#include <memory>
......@@ -12,13 +10,17 @@
#include "CSVReader.h"
#include "exceptions.h"
bool is_file_accessible(std::string file_path)
{
return std::ifstream(file_path).good();
}
namespace lib4neuro {
CSVReader::CSVReader(std::string file_path,
std::string delimiter,
bool ignore_first_line) {
if (!std::experimental::filesystem::exists(file_path)) {
THROW_RUNTIME_ERROR("The file path \'" + file_path + "\' specified in CSVReader does not exist!");
if (!is_file_accessible(file_path)) {
THROW_RUNTIME_ERROR("The file path \'" + file_path + "\' specified in CSVReader is not accessible!");
}
this->file_path = file_path;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment