|
void | reverse (void *buf, size_t len) |
|
template<class FD>
class Belle2::FileWriter< FD >
Definition at line 20 of file FileWriter.h.
◆ FileWriter() [1/2]
◆ FileWriter() [2/2]
◆ ~FileWriter()
◆ available()
virtual bool available |
( |
| ) |
|
|
inlinevirtual |
◆ reverse()
void reverse |
( |
void * |
buf, |
|
|
size_t |
len |
|
) |
| |
|
protectedinherited |
Definition at line 18 of file Writer.cc.
19{
20 for (int c = 0 ; c < (int)len / 2 ; c ++) {
21 char tmp = *((char*)buf + c);
22 *((char*)buf + c) = *((char*)buf + len - 1 - c);
23 *((char*)buf + len - 1 - c) = tmp;
24 }
25}
◆ write()
virtual size_t write |
( |
const void * |
v, |
|
|
size_t |
count |
|
) |
| |
|
inlinevirtual |
Implements Writer.
Definition at line 28 of file FileWriter.h.
29 {
30 return _fd.write(v, count);
31 }
◆ writeBool()
Definition at line 27 of file Writer.cc.
28{
29 write(&v, sizeof(bool));
30}
◆ writeChar()
Definition at line 32 of file Writer.cc.
33{
34 write(&v, sizeof(char));
35}
◆ writeDouble()
void writeDouble |
( |
double |
v | ) |
|
|
virtualinherited |
Definition at line 98 of file Writer.cc.
99{
100#if defined(__ENDIAN_L__)
101 reverse(&v, sizeof(double));
102#endif
103 write(&v, sizeof(double));
104}
◆ writeFloat()
void writeFloat |
( |
float |
v | ) |
|
|
virtualinherited |
Definition at line 90 of file Writer.cc.
91{
92#if defined(__ENDIAN_L__)
93 reverse(&v, sizeof(float));
94#endif
95 write(&v, sizeof(float));
96}
◆ writeInt()
Definition at line 58 of file Writer.cc.
59{
60#if defined(__ENDIAN_L__)
61 reverse(&v, sizeof(int));
62#endif
63 write(&v, sizeof(int));
64}
◆ writeLong()
void writeLong |
( |
long long |
v | ) |
|
|
virtualinherited |
Definition at line 74 of file Writer.cc.
75{
76#if defined(__ENDIAN_L__)
77 reverse(&v, sizeof(long long));
78#endif
79 write(&v, sizeof(long long));
80}
◆ writeObject()
Definition at line 112 of file Writer.cc.
113{
114 return v.writeObject(*this);
115}
◆ writeShort()
void writeShort |
( |
short |
v | ) |
|
|
virtualinherited |
Definition at line 42 of file Writer.cc.
43{
44#if defined(__ENDIAN_L__)
45 reverse(&v, sizeof(short));
46#endif
47 write(&v, sizeof(short));
48}
◆ writeString()
void writeString |
( |
const std::string & |
v | ) |
|
|
virtualinherited |
Definition at line 106 of file Writer.cc.
107{
108 writeInt((int)v.size());
109 write(v.data(), v.size());
110}
◆ writeUChar()
void writeUChar |
( |
unsigned char |
v | ) |
|
|
virtualinherited |
Definition at line 37 of file Writer.cc.
38{
39 write(&v, sizeof(unsigned char));
40}
◆ writeUInt()
void writeUInt |
( |
unsigned int |
v | ) |
|
|
virtualinherited |
Definition at line 66 of file Writer.cc.
67{
68#if defined(__ENDIAN_L__)
69 reverse(&v, sizeof(unsigned int));
70#endif
71 write(&v, sizeof(unsigned int));
72}
◆ writeULong()
void writeULong |
( |
unsigned long long |
v | ) |
|
|
virtualinherited |
Definition at line 82 of file Writer.cc.
83{
84#if defined(__ENDIAN_L__)
85 reverse(&v, sizeof(unsigned long long));
86#endif
87 write(&v, sizeof(unsigned long long));
88}
◆ writeUShort()
void writeUShort |
( |
unsigned short |
v | ) |
|
|
virtualinherited |
Definition at line 50 of file Writer.cc.
51{
52#if defined(__ENDIAN_L__)
53 reverse(&v, sizeof(unsigned short));
54#endif
55 write(&v, sizeof(unsigned short));
56}
◆ _fd
The documentation for this class was generated from the following file: