27 const std::vector<uint8_t>& vec,
const std::string& fileName);
34 std::vector<uint8_t>& out_data,
const std::string& fileName);
40 bool loadTextFile(std::vector<std::string>& o,
const std::string& fileName);
55 const std::vector<float>& vec,
const std::string& fileName,
56 bool append =
false,
bool byRows =
false);
59 const std::vector<double>& vec,
const std::string& fileName,
60 bool append =
false,
bool byRows =
false);
63 const std::vector<int>& vec,
const std::string& fileName,
64 bool append =
false,
bool byRows =
false);
67 const std::vector<size_t>& vec,
const std::string& fileName,
68 bool append =
false,
bool byRows =
false);
70 template <
class EIGEN_MATRIX>
75 vec.saveToTextFile(fileName);
89 std::vector<double>& vec,
const std::string& fileName,
90 const bool byRows =
false);
bool vectorToBinaryFile(const std::vector< uint8_t > &vec, const std::string &fileName)
Saves a vector directly as a binary dump to a file:
bool loadBinaryFile(std::vector< uint8_t > &out_data, const std::string &fileName)
Loads a entire file as a vector of bytes.
bool loadTextFile(std::vector< std::string > &o, const std::string &fileName)
Loads a text file as a vector of string lines.
std::string file_get_contents(const std::string &fileName)
Loads an entire text file and return its contents as a single std::string.
bool vectorToTextFile(const std::vector< float > &vec, const std::string &fileName, bool append=false, bool byRows=false)
A useful function for debugging, which saves a numeric std::vector as a plain-text file compatible wi...
bool vectorNumericFromTextFile(std::vector< double > &vec, const std::string &fileName, const bool byRows=false)
Load a numeric std::vector<double> from a text file (compat.