xmscore
1.0
|
#include <xmscore/dataio/daStreamIo.h>
#include <fstream>
#include <sstream>
#include <boost/archive/iterators/base64_from_binary.hpp>
#include <boost/archive/iterators/binary_from_base64.hpp>
#include <boost/archive/iterators/transform_width.hpp>
#include <boost/unordered_map.hpp>
#include <zlib.h>
#include <xmscore/misc/StringUtil.h>
#include <xmscore/misc/XmError.h>
#include <xmscore/misc/XmLog.h>
#include <xmscore/dataio/daStreamIo.t.h>
#include <numeric>
Go to the source code of this file.
Classes | |
class | xms::DaStreamReader::Impl |
Implementation for DaStreamReader. More... | |
class | xms::DaStreamWriter::Impl |
Implementation for DaStreamWriter. More... | |
Functions | |
bool | xms::daReadNamedLine (std::istream &a_inStream, const char *a_name) |
Read a line that begins with a name. More... | |
bool | xms::daReadLine (std::istream &a_inStream, std::string &a_line) |
Read a line from a stream with the following line endings: CR LF, LF, CR, or none. More... | |
bool | xms::daReadIntLine (std::istream &a_inStream, const char *a_name, int &a_val) |
Read a named integer value from a line. More... | |
bool | xms::daReadDoubleLine (std::istream &a_inStream, const char *a_name, double &a_val) |
Read a named double value from a line. More... | |
bool | xms::daReadStringLine (std::istream &a_inStream, const char *a_name, std::string &a_val) |
Read a named string value from a line. More... | |
bool | xms::daReadVecInt (std::istream &a_inStream, const char *a_name, VecInt &a_vec) |
Read named vector of integers from multiple lines. More... | |
bool | xms::daReadVecDbl (std::istream &a_inStream, const char *a_name, VecDbl &a_vec) |
Read named vector of doubles from multiple lines. More... | |
bool | xms::daReadVecPt3d (std::istream &a_inStream, const char *a_name, VecPt3d &a_vec) |
Read named vector of Pt3d from multiple lines. More... | |
bool | xms::daRead2StringLine (std::istream &a_inStream, const char *a_name, std::string &a_val1, std::string &a_val2) |
Read a named pair of words from a line. More... | |
bool | xms::daRead3StringLine (std::istream &a_inStream, const char *a_name, std::string &a_val1, std::string &a_val2, std::string &a_val3) |
Read a named triplet of words from a line. More... | |
bool | xms::daRead3DoubleLine (std::istream &a_inStream, const char *a_name, double &a_val1, double &a_val2, double &a_val3) |
Read a named triplet of doubles from a line. More... | |
bool | xms::daReadIntFromLine (std::string &a_line, int &a_val) |
Read an integer value from a string. Return the remaining string. More... | |
bool | xms::daReadStringFromLine (std::string &a_line, std::string &a_val) |
Read a string value from a string. Return the remaining string. More... | |
bool | xms::daReadDoubleFromLine (std::string &a_line, double &a_val) |
Read a double value from a string. Return the remaining string. More... | |
bool | xms::daLineBeginsWith (std::istream &a_inStream, const std::string &a_text) |
Determines if next line read will begin given text. More... | |
void | xms::daWriteNamedLine (std::ostream &a_outStream, const char *a_name) |
Write a given line to a stream. More... | |
void | xms::daWriteLine (std::ostream &a_outStream, const std::string &a_line) |
Write a given line to a stream. More... | |
void | xms::daWriteDoubleLine (std::ostream &a_outStream, const char *a_name, double a_val) |
Write a named double line value. More... | |
void | xms::daWriteStringLine (std::ostream &a_outStream, const char *a_name, const std::string &a_val) |
Write a named word line. More... | |
void | xms::daWriteVecInt (std::ostream &a_outStream, const char *a_name, const VecInt &a_vec) |
Write a named vector of integers to several lines. More... | |
void | xms::daWrite2StringLine (std::ostream &a_outStream, const char *a_name, const std::string &a_val1, const std::string &a_val2) |
Write a named pair of words to a line. More... | |
void | xms::daWrite3StringLine (std::ostream &a_outStream, const char *a_name, const std::string &a_val1, const std::string &a_val2, const std::string &a_val3) |
Write a named triplet of words to a line. More... | |
void | xms::daWrite3DoubleLine (std::ostream &a_outStream, const char *a_name, const double &a_val1, const double &a_val2, const double &a_val3) |
Write a named triplet of doubles to a line. More... | |
void | xms::daWriteIntLine (std::ostream &a_outStream, const char *a_name, int a_val) |
Write a named integer value to a line. More... | |
void | xms::daWriteVecDbl (std::ostream &a_outStream, const char *a_name, const VecDbl &a_vec) |
Write a named vector of doubles to multiple lines. More... | |
void | xms::daWriteVecPt3d (std::ostream &a_outStream, const char *a_name, const VecPt3d &a_points) |
Write a named vector of Pt3d to multiple lines. More... | |
Definition in file daStreamIo.cpp.
bool xms::daLineBeginsWith | ( | std::istream & | a_inStream, |
const std::string & | a_text | ||
) |
Determines if next line read will begin given text.
a_inStream | The stream to read from. |
a_text | The text to check for. |
Definition at line 1204 of file daStreamIo.cpp.
References xms::daLineBeginsWith(), and xms::daReadLine().
Referenced by xms::daLineBeginsWith(), xms::DaStreamReader::LineBeginsWith(), and DaStreamIoUnitTests::testLineBeginsWith().
bool xms::daRead2StringLine | ( | std::istream & | a_inStream, |
const char * | a_name, | ||
std::string & | a_val1, | ||
std::string & | a_val2 | ||
) |
Read a named pair of words from a line.
a_inStream | The stream to read from. |
a_name | The expected name before the value. |
a_val1 | The first word. |
a_val2 | The second word. |
Definition at line 1118 of file daStreamIo.cpp.
References xms::daRead2StringLine().
Referenced by xms::daRead2StringLine(), and DaStreamIoUnitTests::testReadWrite2StringLine().
bool xms::daRead3DoubleLine | ( | std::istream & | a_inStream, |
const char * | a_name, | ||
double & | a_val1, | ||
double & | a_val2, | ||
double & | a_val3 | ||
) |
Read a named triplet of doubles from a line.
a_inStream | The stream to read from. |
a_name | The expected name before the value. |
a_val1 | The first double. |
a_val2 | The second double. |
a_val3 | The third double. |
Definition at line 1151 of file daStreamIo.cpp.
References xms::daRead3DoubleLine().
Referenced by xms::daRead3DoubleLine(), and DaStreamIoUnitTests::testReadWrite3DoubleLine().
bool xms::daRead3StringLine | ( | std::istream & | a_inStream, |
const char * | a_name, | ||
std::string & | a_val1, | ||
std::string & | a_val2, | ||
std::string & | a_val3 | ||
) |
Read a named triplet of words from a line.
a_inStream | The stream to read from. |
a_name | The expected name before the value. |
a_val1 | The first word. |
a_val2 | The second word. |
a_val3 | The third word. |
Definition at line 1134 of file daStreamIo.cpp.
References xms::daRead3StringLine().
Referenced by xms::daRead3StringLine(), and DaStreamIoUnitTests::testReadWrite3StringLine().
bool xms::daReadDoubleFromLine | ( | std::string & | a_line, |
double & | a_val | ||
) |
Read a double value from a string. Return the remaining string.
a_line | The string to read from. Returns the remaining string. |
a_val | The value to read. |
Definition at line 1194 of file daStreamIo.cpp.
References xms::daReadDoubleFromLine().
Referenced by xms::daReadDoubleFromLine(), xms::daReadVecPt3d(), xms::DaStreamReader::ReadVecPt3d(), and DaStreamIoUnitTests::testReadDoubleFromLine().
bool xms::daReadDoubleLine | ( | std::istream & | a_inStream, |
const char * | a_name, | ||
double & | a_val | ||
) |
Read a named double value from a line.
a_inStream | The stream to read from. |
a_name | The expected name before the value. |
a_val | The double value. |
Definition at line 1035 of file daStreamIo.cpp.
References xms::daReadDoubleLine().
Referenced by xms::daReadDoubleLine(), and DaStreamIoUnitTests::testReadWriteDoubleLine().
bool xms::daReadIntFromLine | ( | std::string & | a_line, |
int & | a_val | ||
) |
Read an integer value from a string. Return the remaining string.
a_line | The string to read from. Returns the remaining string. |
a_val | The value to read. |
Definition at line 1165 of file daStreamIo.cpp.
References xms::daReadIntFromLine().
Referenced by xms::daReadIntFromLine(), xms::daReadVecPt3d(), xms::DaStreamReader::ReadVecPt3d(), and DaStreamIoUnitTests::testReadIntFromLine().
bool xms::daReadIntLine | ( | std::istream & | a_inStream, |
const char * | a_name, | ||
int & | a_val | ||
) |
Read a named integer value from a line.
a_inStream | The stream to read from. |
a_name | The expected name before the value. |
a_val | The integer value. |
Definition at line 1024 of file daStreamIo.cpp.
References xms::daReadIntLine().
Referenced by xms::daReadIntLine(), xms::daReadVecPt3d(), xms::DaStreamReader::ReadVecPt3d(), and DaStreamIoUnitTests::testReadWriteIntLine().
bool xms::daReadLine | ( | std::istream & | a_inStream, |
std::string & | a_line | ||
) |
Read a line from a stream with the following line endings: CR LF, LF, CR, or none.
a_inStream | The stream to read from. |
a_line | The line that was read. |
Definition at line 978 of file daStreamIo.cpp.
References xms::daReadLine().
Referenced by xms::daLineBeginsWith(), xms::daReadLine(), xms::daReadVecPt3d(), xms::DaStreamReader::ReadVecPt3d(), DaStreamIoUnitTests::testLineBeginsWith(), and DaStreamIoUnitTests::testReadWriteLine().
bool xms::daReadNamedLine | ( | std::istream & | a_inStream, |
const char * | a_name | ||
) |
Read a line that begins with a name.
a_inStream | The stream to read from. |
a_name | The expected name before the value. |
Definition at line 966 of file daStreamIo.cpp.
References xms::daReadNamedLine().
Referenced by xms::daReadNamedLine(), and DaStreamIoUnitTests::testReadNamedLine().
bool xms::daReadStringFromLine | ( | std::string & | a_line, |
std::string & | a_val | ||
) |
Read a string value from a string. Return the remaining string.
a_line | The string to read from. Returns the remaining string. |
a_val | The value to read. |
Definition at line 1175 of file daStreamIo.cpp.
References xms::daReadStringFromLine().
Referenced by xms::daReadStringFromLine(), xms::daReadVecPt3d(), xms::DaStreamReader::ReadVecPt3d(), and DaStreamIoUnitTests::testReadStringFromLine().
bool xms::daReadStringLine | ( | std::istream & | a_inStream, |
const char * | a_name, | ||
std::string & | a_val | ||
) |
Read a named string value from a line.
a_inStream | The stream to read from. |
a_name | The expected name before the value. |
a_val | The string value. |
Definition at line 1046 of file daStreamIo.cpp.
References xms::daReadStringLine().
Referenced by xms::daReadStringLine(), and DaStreamIoUnitTests::testReadWriteStringLine().
bool xms::daReadVecDbl | ( | std::istream & | a_inStream, |
const char * | a_name, | ||
VecDbl & | a_vec | ||
) |
Read named vector of doubles from multiple lines.
a_inStream | The stream to read from. |
a_name | The expected name before the value. |
a_vec | The vector of doubles. |
Definition at line 1068 of file daStreamIo.cpp.
References xms::daReadVecDbl().
Referenced by xms::daReadVecDbl(), and DaStreamIoUnitTests::testReadWriteVecDbl().
bool xms::daReadVecInt | ( | std::istream & | a_inStream, |
const char * | a_name, | ||
VecInt & | a_vec | ||
) |
Read named vector of integers from multiple lines.
a_inStream | The stream to read from. |
a_name | The expected name before the value. |
a_vec | The vector of integers. |
Definition at line 1057 of file daStreamIo.cpp.
References xms::daReadVecInt().
Referenced by xms::daReadVecInt(), and DaStreamIoUnitTests::testReadWriteVecInt().
bool xms::daReadVecPt3d | ( | std::istream & | a_inStream, |
const char * | a_name, | ||
VecPt3d & | a_vec | ||
) |
Read named vector of Pt3d from multiple lines.
a_inStream | The stream to read from. |
a_name | The expected name before the value. |
a_vec | The vector of Pt3d. |
Definition at line 1079 of file daStreamIo.cpp.
References xms::daReadDoubleFromLine(), xms::daReadIntFromLine(), xms::daReadIntLine(), xms::daReadLine(), xms::daReadStringFromLine(), xms::daReadVecPt3d(), xms::Pt3< T >::x, xms::Pt3< T >::y, and xms::Pt3< T >::z.
Referenced by xms::daReadVecPt3d(), and DaStreamIoUnitTests::testReadWriteVecPt3d().
void xms::daWrite2StringLine | ( | std::ostream & | a_outStream, |
const char * | a_name, | ||
const std::string & | a_val1, | ||
const std::string & | a_val2 | ||
) |
Write a named pair of words to a line.
a_outStream | The stream to write too. |
a_name | The name to be written before the value. |
a_val1 | The first word. |
a_val2 | The second word. |
Definition at line 1279 of file daStreamIo.cpp.
References xms::daWrite2StringLine().
Referenced by xms::daWrite2StringLine(), DaStreamIoUnitTests::testReadWrite2StringLine(), and xms::DaStreamWriter::Write2StringLine().
void xms::daWrite3DoubleLine | ( | std::ostream & | a_outStream, |
const char * | a_name, | ||
const double & | a_val1, | ||
const double & | a_val2, | ||
const double & | a_val3 | ||
) |
Write a named triplet of doubles to a line.
a_outStream | The stream to write too. |
a_name | The name to be written before the value. |
a_val1 | The first double. |
a_val2 | The second double. |
a_val3 | The third double. |
Definition at line 1310 of file daStreamIo.cpp.
References xms::daWrite3DoubleLine(), and xms::STRstd().
Referenced by xms::daWrite3DoubleLine(), DaStreamIoUnitTests::testReadWrite3DoubleLine(), and xms::DaStreamWriter::Write3DoubleLine().
void xms::daWrite3StringLine | ( | std::ostream & | a_outStream, |
const char * | a_name, | ||
const std::string & | a_val1, | ||
const std::string & | a_val2, | ||
const std::string & | a_val3 | ||
) |
Write a named triplet of words to a line.
a_outStream | The stream to write too. |
a_name | The name to be written before the value. |
a_val1 | The first word. |
a_val2 | The second word. |
a_val3 | The third word. |
Definition at line 1294 of file daStreamIo.cpp.
References xms::daWrite3StringLine().
Referenced by xms::daWrite3StringLine(), DaStreamIoUnitTests::testReadWrite3StringLine(), and xms::DaStreamWriter::Write3StringLine().
void xms::daWriteDoubleLine | ( | std::ostream & | a_outStream, |
const char * | a_name, | ||
double | a_val | ||
) |
Write a named double line value.
a_outStream | The stream to write too. |
a_name | The name to be written before the value. |
a_val | The double value to write. |
Definition at line 1241 of file daStreamIo.cpp.
References xms::daWriteDoubleLine(), and xms::STRstd().
Referenced by xms::daWriteDoubleLine(), DaStreamIoUnitTests::testReadWriteDoubleLine(), and xms::DaStreamWriter::WriteDoubleLine().
void xms::daWriteIntLine | ( | std::ostream & | a_outStream, |
const char * | a_name, | ||
int | a_val | ||
) |
Write a named integer value to a line.
a_outStream | The stream to write too. |
a_name | The name to be written before the value. |
a_val | The integer value. |
Definition at line 1325 of file daStreamIo.cpp.
References xms::daWriteIntLine().
Referenced by xms::daWriteIntLine(), DaStreamIoUnitTests::testReadWriteIntLine(), and xms::DaStreamWriter::WriteIntLine().
void xms::daWriteLine | ( | std::ostream & | a_outStream, |
const std::string & | a_line | ||
) |
Write a given line to a stream.
a_outStream | The stream to write too. |
a_line | The line of text to be written. |
Definition at line 1231 of file daStreamIo.cpp.
References xms::daWriteLine().
Referenced by xms::daWriteLine(), DaStreamIoUnitTests::testReadWriteLine(), and xms::DaStreamWriter::WriteLine().
void xms::daWriteNamedLine | ( | std::ostream & | a_outStream, |
const char * | a_name | ||
) |
Write a given line to a stream.
a_outStream | The stream to write too. |
a_name | The line of text to be written. |
Definition at line 1222 of file daStreamIo.cpp.
References xms::daWriteNamedLine().
Referenced by xms::daWriteNamedLine().
void xms::daWriteStringLine | ( | std::ostream & | a_outStream, |
const char * | a_name, | ||
const std::string & | a_val | ||
) |
Write a named word line.
a_outStream | The stream to write too. |
a_name | The name to be written before the value. |
a_val | The word. |
Definition at line 1253 of file daStreamIo.cpp.
References xms::daWriteStringLine().
Referenced by xms::daWriteStringLine(), DaStreamIoUnitTests::testReadWriteStringLine(), and xms::DaStreamWriter::WriteStringLine().
void xms::daWriteVecDbl | ( | std::ostream & | a_outStream, |
const char * | a_name, | ||
const VecDbl & | a_vec | ||
) |
Write a named vector of doubles to multiple lines.
a_outStream | The stream to write too. |
a_name | The name to be written before the value. |
a_vec | The vector of doubles. |
Definition at line 1335 of file daStreamIo.cpp.
References xms::daWriteVecDbl(), and xms::STRstd().
Referenced by xms::daWriteVecDbl(), DaStreamIoUnitTests::testReadWriteVecDbl(), and xms::DaStreamWriter::WriteVecDbl().
void xms::daWriteVecInt | ( | std::ostream & | a_outStream, |
const char * | a_name, | ||
const VecInt & | a_vec | ||
) |
Write a named vector of integers to several lines.
a_outStream | The stream to write too. |
a_name | The name to be written before the value. |
a_vec | The vector of integers. |
Definition at line 1263 of file daStreamIo.cpp.
References xms::daWriteVecInt().
Referenced by xms::daWriteVecInt(), DaStreamIoUnitTests::testReadWriteVecInt(), and xms::DaStreamWriter::WriteVecInt().
void xms::daWriteVecPt3d | ( | std::ostream & | a_outStream, |
const char * | a_name, | ||
const VecPt3d & | a_points | ||
) |
Write a named vector of Pt3d to multiple lines.
a_outStream | The stream to write too. |
a_name | The name to be written before the value. |
a_points | The vector of Pt3d. |
Definition at line 1351 of file daStreamIo.cpp.
References xms::daWriteVecPt3d(), xms::STRstd(), xms::Pt3< T >::x, xms::Pt3< T >::y, and xms::Pt3< T >::z.
Referenced by xms::daWriteVecPt3d(), DaStreamIoUnitTests::testReadWriteVecPt3d(), and xms::DaStreamWriter::WriteVecPt3d().