Definition at line 22 of file wbuf.
◆ wbuf() [1/2]
tools::wroot::wbuf::wbuf |
( |
std::ostream & |
a_out, |
|
|
bool |
a_byte_swap, |
|
|
const char * |
a_eob, |
|
|
char *& |
a_pos |
|
) |
| |
|
inline |
Definition at line 74 of file wbuf.
85 mem::increment(s_class().c_str());
◆ ~wbuf()
virtual tools::wroot::wbuf::~wbuf |
( |
| ) |
|
|
inlinevirtual |
Definition at line 89 of file wbuf.
91 mem::decrement(s_class().c_str());
◆ wbuf() [2/2]
tools::wroot::wbuf::wbuf |
( |
const wbuf & |
a_from | ) |
|
|
inline |
Definition at line 95 of file wbuf.
105 mem::increment(s_class().c_str());
◆ byte_swap()
bool tools::wroot::wbuf::byte_swap |
( |
| ) |
const |
|
inline |
Definition at line 120 of file wbuf.
◆ check_eob() [1/2]
template<class T >
bool tools::wroot::wbuf::check_eob |
( |
| ) |
|
|
inlineprotected |
Definition at line 230 of file wbuf.
232 m_out << s_class() <<
" : " <<
stype(T()) <<
" : "
234 <<
" try to access out of buffer " <<
sizeof(T) <<
" bytes"
235 <<
" (pos=" << charp_out(
m_pos)
236 <<
", eob=" << charp_out(
m_eob) <<
")." << std::endl;
◆ check_eob() [2/2]
bool tools::wroot::wbuf::check_eob |
( |
size_t |
a_n, |
|
|
const char * |
a_cmt |
|
) |
| |
|
inlineprotected |
Definition at line 241 of file wbuf.
243 m_out << s_class() <<
" : " << a_cmt <<
" : "
245 <<
" try to access out of buffer " << a_n <<
" bytes"
246 <<
" (pos=" << charp_out(
m_pos)
247 <<
", eob=" << charp_out(
m_eob) <<
")." << std::endl;
◆ operator=()
wbuf& tools::wroot::wbuf::operator= |
( |
const wbuf & |
a_from | ) |
|
|
inline |
Definition at line 109 of file wbuf.
111 m_eob = a_from.m_eob;
◆ set_byte_swap()
void tools::wroot::wbuf::set_byte_swap |
( |
bool |
a_value | ) |
|
|
inline |
Definition at line 121 of file wbuf.
◆ set_eob()
void tools::wroot::wbuf::set_eob |
( |
const char * |
a_eob | ) |
|
|
inline |
Definition at line 119 of file wbuf.
◆ write() [1/13]
bool tools::wroot::wbuf::write |
( |
char |
a_x | ) |
|
|
inline |
Definition at line 175 of file wbuf.
175 {
return write((
unsigned char)a_x);}
◆ write() [2/13]
bool tools::wroot::wbuf::write |
( |
const std::string & |
a_x | ) |
|
|
inline |
Definition at line 180 of file wbuf.
182 unsigned int nchars = (
unsigned int)a_x.size();
184 if(!
check_eob(1+4,
"std::string"))
return false;
186 if(!
write(nwh))
return false;
187 if(!
write(nchars))
return false;
189 if(!
check_eob(1,
"std::string"))
return false;
190 nwh = (
unsigned char)nchars;
191 if(!
write(nwh))
return false;
193 if(!
check_eob(nchars,
"std::string"))
return false;
194 for (
unsigned int i = 0; i < nchars; i++)
m_pos[i] = a_x[i];
◆ write() [3/13]
template<class T >
bool tools::wroot::wbuf::write |
( |
const std::vector< T > & |
a_v | ) |
|
|
inline |
Definition at line 217 of file wbuf.
218 if(a_v.empty())
return true;
223 if(!
write(a_v[i]))
return false;
◆ write() [4/13]
template<class T >
bool tools::wroot::wbuf::write |
( |
const T * |
a_a, |
|
|
uint32 |
a_n |
|
) |
| |
|
inline |
Definition at line 201 of file wbuf.
202 if(!a_n)
return true;
203 uint32 l = a_n *
sizeof(T);
206 for(
uint32 i=0;i<a_n;i++) {
207 if(!
write(a_a[i]))
return false;
210 ::memcpy(
m_pos,a_a,l);
◆ write() [5/13]
bool tools::wroot::wbuf::write |
( |
double |
a_x | ) |
|
|
inline |
Definition at line 168 of file wbuf.
169 if(!check_eob<double>())
return false;
171 m_pos +=
sizeof(double);
◆ write() [6/13]
bool tools::wroot::wbuf::write |
( |
float |
a_x | ) |
|
|
inline |
Definition at line 161 of file wbuf.
162 if(!check_eob<float>())
return false;
164 m_pos +=
sizeof(float);
◆ write() [7/13]
bool tools::wroot::wbuf::write |
( |
int |
a_x | ) |
|
|
inline |
Definition at line 177 of file wbuf.
177 {
return write((
unsigned int)a_x);}
◆ write() [8/13]
bool tools::wroot::wbuf::write |
( |
int64 |
a_x | ) |
|
|
inline |
Definition at line 178 of file wbuf.
◆ write() [9/13]
bool tools::wroot::wbuf::write |
( |
short |
a_x | ) |
|
|
inline |
Definition at line 176 of file wbuf.
176 {
return write((
unsigned short)a_x);}
◆ write() [10/13]
bool tools::wroot::wbuf::write |
( |
uint64 |
a_x | ) |
|
|
inline |
Definition at line 154 of file wbuf.
155 if(!check_eob<uint64>())
return false;
◆ write() [11/13]
bool tools::wroot::wbuf::write |
( |
unsigned char |
a_x | ) |
|
|
inline |
Definition at line 134 of file wbuf.
135 if(!check_eob<unsigned char>())
return false;
◆ write() [12/13]
bool tools::wroot::wbuf::write |
( |
unsigned int |
a_x | ) |
|
|
inline |
Definition at line 147 of file wbuf.
148 if(!check_eob<unsigned int>())
return false;
150 m_pos +=
sizeof(
unsigned int);
◆ write() [13/13]
bool tools::wroot::wbuf::write |
( |
unsigned short |
a_x | ) |
|
|
inline |
Definition at line 140 of file wbuf.
141 if(!check_eob<unsigned short>())
return false;
143 m_pos +=
sizeof(
unsigned short);
◆ m_byte_swap
bool tools::wroot::wbuf::m_byte_swap |
|
protected |
Definition at line 255 of file wbuf.
◆ m_eob
const char* tools::wroot::wbuf::m_eob |
|
protected |
Definition at line 256 of file wbuf.
◆ m_out
std::ostream& tools::wroot::wbuf::m_out |
|
protected |
Definition at line 254 of file wbuf.
◆ m_pos
char*& tools::wroot::wbuf::m_pos |
|
protected |
Definition at line 257 of file wbuf.
◆ m_w_2_func
w_2_func tools::wroot::wbuf::m_w_2_func |
|
protected |
Definition at line 259 of file wbuf.
◆ m_w_4_func
w_4_func tools::wroot::wbuf::m_w_4_func |
|
protected |
Definition at line 260 of file wbuf.
◆ m_w_8_func
w_8_func tools::wroot::wbuf::m_w_8_func |
|
protected |
Definition at line 261 of file wbuf.
The documentation for this class was generated from the following file:
- /Users/barrand/private/dev/softinex/g4tools/g4tools/tools/wroot/wbuf