diff --git a/readvector.cpp b/readvector.cpp index aae5869d..7b5adc5a 100644 --- a/readvector.cpp +++ b/readvector.cpp @@ -18,6 +18,8 @@ #include +#include "readvector.hpp" + struct ParserState { int error; }; @@ -260,21 +262,21 @@ static char *convert_string(double *value, char *str) /* ------------------------------------------------------------------ */ template -void read_vector_from_file(const char *fn, std::vector& v) +void read_vector_from_file(const std::string& fn, std::vector& v) { - FILE *fp = fopen(fn, "r"); + FILE *fp = fopen(fn.c_str(), "r"); struct ParserState s = { 0 }; readvector(fp, &s, v); fclose(fp); } -void read_vector_from_file(const char *fn, std::vector& v) +void read_vector_from_file(const std::string& fn, std::vector& v) { read_vector_from_file(fn, v); } -void read_vector_from_file(const char *fn, std::vector& v) +void read_vector_from_file(const std::string& fn, std::vector& v) { read_vector_from_file(fn, v); } diff --git a/readvector.hpp b/readvector.hpp index 5f96fcca..04cdb977 100644 --- a/readvector.hpp +++ b/readvector.hpp @@ -16,7 +16,9 @@ #ifndef READVECTOR_HPP_HEADER #define READVECTOR_HPP_HEADER -void read_vector_from_file(const char *fn, std::vector& v); -void read_vector_from_file(const char *fn, std::vector& v); +#include + +void read_vector_from_file(const std::string&, std::vector& v); +void read_vector_from_file(const std::string&, std::vector& v); #endif /* READVECTOR_HPP_HEADER */