Functions
vsl_quick_file.h File Reference

Functions for quickly loading and saving binary files. More...

#include <string>
#include <iostream>
#include <cerrno>
#include <vsl/vsl_binary_io.h>

Go to the source code of this file.

Functions

template<class T >
bool vsl_quick_file_load (T &data, const std::string &path, std::ostream *errorStream=&std::cerr)
 Load something from a file. More...
 
template<class T >
bool vsl_quick_file_save (const T &data, const std::string &path, std::ostream *errorStream=&std::cerr)
 Save something to a file. More...
 
template<class T , class S >
bool vsl_quick_file_load (T &data1, S &data2, const std::string &path, std::ostream *errorStream=&std::cerr)
 
template<class T , class S >
bool vsl_quick_file_save (const T &data1, const S &data2, const std::string &path, std::ostream *errorStream=&std::cerr)
 
template<class T , class S , class U >
bool vsl_quick_file_load (T &data1, S &data2, U &data3, const std::string &path, std::ostream *errorStream=&std::cerr)
 
template<class T , class S , class U >
bool vsl_quick_file_save (const T &data1, const S &data2, const U &data3, const std::string &path, std::ostream *errorStream=&std::cerr)
 
template<class T , class S , class U , class V >
bool vsl_quick_file_load (T &data1, S &data2, U &data3, V &data4, const std::string &path, std::ostream *errorStream=&std::cerr)
 
template<class T , class S , class U , class V >
bool vsl_quick_file_save (const T &data1, const S &data2, const U &data3, const V &data4, const std::string &path, std::ostream *errorStream=&std::cerr)
 
template<class T , class S , class U , class V , class W >
bool vsl_quick_file_load (T &data1, S &data2, U &data3, V &data4, W &data5, const std::string &path, std::ostream *errorStream=&std::cerr)
 
template<class T , class S , class U , class V , class W >
bool vsl_quick_file_save (const T &data1, const S &data2, const U &data3, const V &data4, const W &data5, const std::string &path, std::ostream *errorStream=&std::cerr)
 
template<class T , class S , class U , class V , class W , class X >
bool vsl_quick_file_load (T &data1, S &data2, U &data3, V &data4, W &data5, X &data6, const std::string &path, std::ostream *errorStream=&std::cerr)
 
template<class T , class S , class U , class V , class W , class X >
bool vsl_quick_file_save (const T &data1, const S &data2, const U &data3, const V &data4, const W &data5, const X &data6, const std::string &path, std::ostream *errorStream=&std::cerr)
 

Detailed Description

Functions for quickly loading and saving binary files.

Author
Ian Scott

All the functions return true if successful. The functions will also output a success or failure message to stderr by default, although you may substitute any std::ostream, or (std::ostream*)0 to avoid the message.

For these templated functions to work, the object must have vsl_b_read and vsl_b_write functions defined for them

Definition in file vsl_quick_file.h.

Function Documentation

◆ vsl_quick_file_load() [1/6]

template<class T >
bool vsl_quick_file_load ( T &  data,
const std::string &  path,
std::ostream *  errorStream = &std::cerr 
)
inline

Load something from a file.

Definition at line 28 of file vsl_quick_file.h.

◆ vsl_quick_file_load() [2/6]

template<class T , class S >
bool vsl_quick_file_load ( T &  data1,
S &  data2,
const std::string &  path,
std::ostream *  errorStream = &std::cerr 
)
inline

Definition at line 83 of file vsl_quick_file.h.

◆ vsl_quick_file_load() [3/6]

template<class T , class S , class U >
bool vsl_quick_file_load ( T &  data1,
S &  data2,
U &  data3,
const std::string &  path,
std::ostream *  errorStream = &std::cerr 
)
inline

Definition at line 143 of file vsl_quick_file.h.

◆ vsl_quick_file_load() [4/6]

template<class T , class S , class U , class V >
bool vsl_quick_file_load ( T &  data1,
S &  data2,
U &  data3,
V &  data4,
const std::string &  path,
std::ostream *  errorStream = &std::cerr 
)
inline

Definition at line 203 of file vsl_quick_file.h.

◆ vsl_quick_file_load() [5/6]

template<class T , class S , class U , class V , class W >
bool vsl_quick_file_load ( T &  data1,
S &  data2,
U &  data3,
V &  data4,
W &  data5,
const std::string &  path,
std::ostream *  errorStream = &std::cerr 
)
inline

Definition at line 265 of file vsl_quick_file.h.

◆ vsl_quick_file_load() [6/6]

template<class T , class S , class U , class V , class W , class X >
bool vsl_quick_file_load ( T &  data1,
S &  data2,
U &  data3,
V &  data4,
W &  data5,
X &  data6,
const std::string &  path,
std::ostream *  errorStream = &std::cerr 
)
inline

Definition at line 330 of file vsl_quick_file.h.

◆ vsl_quick_file_save() [1/6]

template<class T >
bool vsl_quick_file_save ( const T &  data,
const std::string &  path,
std::ostream *  errorStream = &std::cerr 
)
inline

Save something to a file.

Definition at line 59 of file vsl_quick_file.h.

◆ vsl_quick_file_save() [2/6]

template<class T , class S >
bool vsl_quick_file_save ( const T &  data1,
const S &  data2,
const std::string &  path,
std::ostream *  errorStream = &std::cerr 
)
inline

Definition at line 117 of file vsl_quick_file.h.

◆ vsl_quick_file_save() [3/6]

template<class T , class S , class U >
bool vsl_quick_file_save ( const T &  data1,
const S &  data2,
const U &  data3,
const std::string &  path,
std::ostream *  errorStream = &std::cerr 
)
inline

Definition at line 176 of file vsl_quick_file.h.

◆ vsl_quick_file_save() [4/6]

template<class T , class S , class U , class V >
bool vsl_quick_file_save ( const T &  data1,
const S &  data2,
const U &  data3,
const V &  data4,
const std::string &  path,
std::ostream *  errorStream = &std::cerr 
)
inline

Definition at line 237 of file vsl_quick_file.h.

◆ vsl_quick_file_save() [5/6]

template<class T , class S , class U , class V , class W >
bool vsl_quick_file_save ( const T &  data1,
const S &  data2,
const U &  data3,
const V &  data4,
const W &  data5,
const std::string &  path,
std::ostream *  errorStream = &std::cerr 
)
inline

Definition at line 300 of file vsl_quick_file.h.

◆ vsl_quick_file_save() [6/6]

template<class T , class S , class U , class V , class W , class X >
bool vsl_quick_file_save ( const T &  data1,
const S &  data2,
const U &  data3,
const V &  data4,
const W &  data5,
const X &  data6,
const std::string &  path,
std::ostream *  errorStream = &std::cerr 
)
inline

Definition at line 366 of file vsl_quick_file.h.