MRPT  1.9.9
io/include/mrpt/io/vector_loadsave.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
11 #include <string>
12 #include <vector>
13 
14 namespace mrpt::io
15 {
16 /** @defgroup vector_loadsave Load and save vectors to files (in #include
17  * <mrpt/io/vector_loadsave.h>)
18  * \ingroup mrpt_io_grp
19  * @{ */
20 
21 /** Saves a vector directly as a binary dump to a file:
22  * \return Returns false on any error, true on everything OK.
23  * \sa loadBinaryFile
24  */
26  const std::vector<uint8_t>& vec, const std::string& fileName);
27 
28 /** Loads a entire file as a vector of bytes.
29  * \return Returns false on any error, true on everything OK.
30  * \sa vectorToBinaryFile
31  */
32 bool loadBinaryFile(
33  std::vector<uint8_t>& out_data, const std::string& fileName);
34 
35 /** Loads a text file as a vector of string lines.
36  * \return Returns false on any error, true on everything OK.
37  */
38 bool loadTextFile(std::vector<std::string>& o, const std::string& fileName);
39 /** @} */
40 
41 }
42 
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.
GLsizei const GLchar ** string
Definition: glext.h:4101



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020