38 explicit DaStreamReader(std::istream& a_inStream,
bool a_binaryArrays =
false);
53 bool Read2StringLine(
const char* a_name, std::string& a_val1, std::string& a_val2);
58 bool Read3DoubleLine(
const char* a_name,
double& a_val1,
double& a_val2,
double& a_val3);
75 std::unique_ptr<Impl>
m_impl;
82 explicit DaStreamWriter(std::ostream& a_outStream,
bool a_binaryArrays =
false);
87 void WriteLine(
const std::string& a_line);
88 void WriteStringLine(
const char* a_name,
const std::string& a_val);
89 void WriteIntLine(
const char* a_name,
int a_val);
90 void WriteDoubleLine(
const char* a_name,
double a_val);
92 void WriteVecInt(
const char* a_name,
const VecInt& a_vec);
93 void WriteVecDbl(
const char* a_name,
const VecDbl& a_vec);
94 void WriteVecPt3d(
const char* a_name,
const VecPt3d& a_points);
96 void Write2StringLine(
const char* a_name,
const std::string& a_val1,
const std::string& a_val2);
97 void Write3StringLine(
const char* a_name,
98 const std::string& a_val1,
99 const std::string& a_val2,
100 const std::string& a_val3);
101 void Write3DoubleLine(
const char* a_name,
102 const double& a_val1,
103 const double& a_val2,
104 const double& a_val3);
106 void WriteString(
const char* a_string);
107 void AppendInt(
int a_val);
108 void AppendInts(
const int* a_vals,
int a_numVals);
109 void AppendString(
const std::string& a_val);
112 bool WriteBinaryBytes(
const char* a_source,
long long a_sourceLength);
113 void SetBinaryBlockSize(
int a_blockSize);
118 std::unique_ptr<Impl> m_impl;
123 bool daReadNamedLine(std::istream& a_inStream, const
char* a_name);
124 bool daReadLine(std::istream& a_inStream, std::
string& a_line);
125 bool daReadIntLine(std::istream& a_inStream, const
char* a_name,
int& a_val);
126 bool daReadDoubleLine(std::istream& a_inStream, const
char* a_name,
double& a_val);
127 bool daReadStringLine(std::istream& a_inStream, const
char* a_name, std::
string& a_val);
128 bool daReadVecInt(std::istream& a_inStream, const
char* a_name,
VecInt& a_vec);
129 bool daReadVecDbl(std::istream& a_inStream, const
char* a_name,
VecDbl& a_vec);
130 bool daReadVecPt3d(std::istream& a_inStream, const
char* a_name,
VecPt3d& a_vec);
131 bool daRead2StringLine(std::istream& a_inStream,
134 std::
string& a_val2);
135 bool daRead3StringLine(std::istream& a_inStream,
139 std::
string& a_val3);
140 bool daRead3DoubleLine(std::istream& a_inStream,
146 bool daReadIntFromLine(std::
string& a_line,
int& a_val);
147 bool daReadStringFromLine(std::
string& a_line, std::
string& a_val);
148 bool daReadDoubleFromLine(std::
string& a_line,
double& a_val);
150 bool daLineBeginsWith(std::istream& a_inStream, const std::
string& a_text);
152 void daWriteVecInt(std::ostream& a_outStream, const
char* a_name, const
VecInt& a_vec);
153 void daWriteVecDbl(std::ostream& a_outStream, const
char* a_name, const
VecDbl& a_vec);
154 void daWriteVecPt3d(std::ostream& a_outStream, const
char* a_name, const
VecPt3d& a_points);
156 void daWriteIntLine(std::ostream& a_outStream, const
char* a_name,
int a_val);
158 void daWriteDoubleLine(std::ostream& a_outStream, const
char* a_name,
double a_val);
159 void daWrite3DoubleLine(std::ostream& a_outStream,
161 const
double& a_val1,
162 const
double& a_val2,
163 const
double& a_val3);
165 void daWriteLine(std::ostream& a_outStream, const std::
string& a_line);
166 void daWriteStringLine(std::ostream& a_outStream, const
char* a_name, const std::
string& a_val);
167 void daWrite2StringLine(std::ostream& a_outStream,
169 const std::
string& a_val1,
170 const std::
string& a_val2);
171 void daWrite3StringLine(std::ostream& a_outStream,
173 const std::
string& a_val1,
174 const std::
string& a_val2,
175 const std::
string& a_val3);
Class for reading ASCII files with named card fields. Also includes the ability to embed non-portable...
std::vector< int > VecInt
short rename
bool ReadString(std::string &a_val)
Read a white space separated string.
bool ReadVecDbl(const char *a_name, VecDbl &a_vec)
Read named vector of doubles from multiple lines.
std::vector< double > VecDbl
short rename
std::unique_ptr< Impl > m_impl
Implementation.
bool ReadInt(int &a_val)
Read an integer value.
bool IsBinary() const
Are array values read as binary?
bool ReadIntLine(const char *a_name, int &a_val)
Read a named integer value from a line.
bool ReadStringLine(const char *a_name, std::string &a_val)
Read a named string value from a line.
static bool ReadDoubleFromLine(std::string &a_line, double &a_val)
Read a double value from a string. Return the remaining string.
bool ReadLine(std::string &a_line)
Read a line from a stream with the following line endings: CR LF, LF, CR, or none.
bool ReadDoubleLine(const char *a_name, double &a_val)
Read a named double value from a line.
bool ReadVecInt(const char *a_name, VecInt &a_vec)
Read named vector of integers from multiple lines.
bool ReadNamedLine(const char *a_name)
Read a line that begins with a name.
bool Read3DoubleLine(const char *a_name, double &a_val1, double &a_val2, double &a_val3)
Read a named triplet of doubles from a line.
Macros etc that make boost more convenient to use.
Implementation for DaStreamReader.
bool ReadBinaryBytes(char *a_dest, long long a_destLength)
Read binary bytes of a given length from a file.
static bool ReadIntFromLine(std::string &a_line, int &a_val)
Read an integer value from a string. Return the remaining string.
bool Read3StringLine(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.
#define XM_DISALLOW_COPY_AND_ASSIGN(TypeName)
A macro to disallow the copy constructor and operator= functions. This should be used in the private:...
DaStreamReader(std::istream &a_inStream, bool a_binaryArrays=false)
Constructor.
bool LineBeginsWith(const char *a_text)
Determines if next line read will begin given text.
Vector types for convenience.
static bool ReadStringFromLine(std::string &a_line, std::string &a_val)
Read a string value from a string. Return the remaining string.
bool ReadVecPt3d(const char *a_name, VecPt3d &a_vec)
Read named vector of Pt3d from multiple lines.
bool NextLine()
Go to the next line in the stream.
Class for writing ASCII files with named card fields. Also includes the ability to embed non-portable...
bool Read2StringLine(const char *a_name, std::string &a_val1, std::string &a_val2)
Read a named pair of words from a line.
~DaStreamReader()
Destructor.
std::vector< Pt3d > VecPt3d
short rename