Main MRPT website > C++ reference for MRPT 1.9.9
Functions
Load and save vectors to files (in #include

Detailed Description

<mrpt/system/vector_loadsave.h>)

Collaboration diagram for Load and save vectors to files (in #include:

Functions

bool mrpt::system::vectorToTextFile (const std::vector< float > &vec, const std::string &fileName, bool append=false, bool byRows=false)
 A useful function for debugging, which saves a std::vector into a text file (compat. More...
 
bool mrpt::system::vectorToTextFile (const std::vector< double > &vec, const std::string &fileName, bool append=false, bool byRows=false)
 
bool mrpt::system::vectorToTextFile (const std::vector< int > &vec, const std::string &fileName, bool append=false, bool byRows=false)
 
bool mrpt::system::vectorToTextFile (const std::vector< size_t > &vec, const std::string &fileName, bool append=false, bool byRows=false)
 
template<class EIGEN_MATRIX >
bool mrpt::system::vectorToTextFile (const EIGEN_MATRIX &vec, const std::string &fileName)
 
bool mrpt::system::vectorFromTextFile (std::vector< double > &vec, const std::string &fileName, const bool byRows=false)
 Load a std::vector from a text file (compat. More...
 
bool mrpt::system::vectorToBinaryFile (const vector_byte &vec, const std::string &fileName)
 Saves a vector directly as a binary dump to a file: More...
 
bool mrpt::system::loadBinaryFile (vector_byte &out_data, const std::string &fileName)
 Loads a entire file as a vector of bytes. More...
 

Function Documentation

◆ loadBinaryFile()

bool mrpt::system::loadBinaryFile ( vector_byte out_data,
const std::string fileName 
)

Loads a entire file as a vector of bytes.

Returns
Returns false on any error, true on everything OK.
See also
vectorToBinaryFile

Definition at line 102 of file vector_loadsave.cpp.

References mrpt::utils::CFileInputStream::getTotalBytesCount(), and mrpt::utils::CStream::ReadBuffer().

Here is the call graph for this function:

◆ vectorFromTextFile()

bool mrpt::system::vectorFromTextFile ( std::vector< double > &  vec,
const std::string fileName,
const bool  byRows = false 
)

Load a std::vector from a text file (compat.

with MATLAB)

Returns
Returns false on any error, true on everything OK.
See also
loadBinaryFile

Definition at line 82 of file vector_loadsave.cpp.

References mrpt::system::os::fopen().

Here is the call graph for this function:

◆ vectorToBinaryFile()

bool mrpt::system::vectorToBinaryFile ( const vector_byte vec,
const std::string fileName 
)

Saves a vector directly as a binary dump to a file:

Returns
Returns false on any error, true on everything OK.
See also
loadBinaryFile

Definition at line 128 of file vector_loadsave.cpp.

References mrpt::utils::CStream::WriteBuffer().

Referenced by mrpt::compress::zip::decompress_gz_data_block(), and mrpt::opengl::C3DSScene::loadFrom3DSFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vectorToTextFile() [1/5]

bool mrpt::system::vectorToTextFile ( const std::vector< float > &  vec,
const std::string fileName,
bool  append = false,
bool  byRows = false 
)

A useful function for debugging, which saves a std::vector into a text file (compat.

with MATLAB)

Returns
Returns false on any error, true on everything OK.

Definition at line 22 of file vector_loadsave.cpp.

References mrpt::system::os::fclose(), mrpt::system::os::fopen(), and mrpt::system::os::fprintf().

Referenced by mrpt::bayes::CKalmanFilterCapable< 7, 3, 3, 7 >::runOneKalmanIteration().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vectorToTextFile() [2/5]

bool mrpt::system::vectorToTextFile ( const std::vector< double > &  vec,
const std::string fileName,
bool  append = false,
bool  byRows = false 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 37 of file vector_loadsave.cpp.

References mrpt::system::os::fclose(), mrpt::system::os::fopen(), and mrpt::system::os::fprintf().

Here is the call graph for this function:

◆ vectorToTextFile() [3/5]

bool mrpt::system::vectorToTextFile ( const std::vector< int > &  vec,
const std::string fileName,
bool  append = false,
bool  byRows = false 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 52 of file vector_loadsave.cpp.

References mrpt::system::os::fclose(), mrpt::system::os::fopen(), and mrpt::system::os::fprintf().

Here is the call graph for this function:

◆ vectorToTextFile() [4/5]

bool mrpt::system::vectorToTextFile ( const std::vector< size_t > &  vec,
const std::string fileName,
bool  append = false,
bool  byRows = false 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 67 of file vector_loadsave.cpp.

References mrpt::system::os::fclose(), mrpt::system::os::fopen(), and mrpt::system::os::fprintf().

Here is the call graph for this function:

◆ vectorToTextFile() [5/5]

template<class EIGEN_MATRIX >
bool mrpt::system::vectorToTextFile ( const EIGEN_MATRIX &  vec,
const std::string fileName 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 43 of file vector_loadsave.h.




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019