#include <RawFileUtil.h>
◆ FileNameStrings() [1/2]
FileNameStrings::FileNameStrings |
( |
| ) |
|
Definition at line 245 of file RawFileUtil.cxx.
246{
247 m_record.
marker = 0x1234aabb;
250 m_appName = "BOSS";
251 m_usrTag = "offline";
252}
◆ FileNameStrings() [2/2]
FileNameStrings::FileNameStrings |
( |
| ) |
|
◆ dump() [1/2]
void FileNameStrings::dump |
( |
std::ostream & |
os = std::cout | ) |
const |
Definition at line 304 of file RawFileUtil.cxx.
304 {
305 os << "[RawFile] FileNameStrings:" << std::endl << std::hex
306 <<
"[RawFile] \tmarker : 0x" << m_record.
marker << std::endl
307 <<
"[RawFile] \tAppName length : 0x" << m_record.
length1 << std::endl
308 << "[RawFile] \tAppName : " << m_appName << std::endl
309 <<
"[RawFile] \tUsrTag length : 0x" << m_record.
length2 << std::endl
310 << "[RawFile] \tUsrTag : " << m_usrTag
311 << std::dec << std::endl;
312}
◆ dump() [2/2]
void FileNameStrings::dump |
( |
std::ostream & |
os = std::cout | ) |
const |
◆ gerAppName() [1/2]
const std::string & FileNameStrings::gerAppName |
( |
| ) |
const |
|
inline |
◆ gerAppName() [2/2]
const std::string & FileNameStrings::gerAppName |
( |
| ) |
const |
|
inline |
◆ gerUsrTag() [1/2]
const std::string & FileNameStrings::gerUsrTag |
( |
| ) |
const |
|
inline |
◆ gerUsrTag() [2/2]
const std::string & FileNameStrings::gerUsrTag |
( |
| ) |
const |
|
inline |
◆ getRecord() [1/2]
◆ getRecord() [2/2]
◆ operator<< [1/2]
Definition at line 185 of file RawFileUtil.cxx.
185 {
186
187 os.write((char*)(&record.m_record), sizeof(uint32_t)*2);
188 uint32_t sizebyte = record.m_record.
length1;
189 uint32_t sizeword = (sizebyte+3)/4;
190 os.write(record.m_appName.c_str(), sizeword*4);
191 os.write((
char*)(&record.m_record.
length2),
sizeof(uint32_t));
192 sizebyte = record.m_record.
length2;
193 sizeword = (sizebyte+3)/4;
194 os.write(record.m_usrTag.c_str(), sizeword*4);
195 if ( os.fail() ) {
196 std::cerr << "[RawFile] Error occurred while writing file" << std::endl;
198 }
199 return os;
200}
◆ operator<< [2/2]
Definition at line 185 of file RawFileUtil.cxx.
185 {
186
187 os.write((char*)(&record.m_record), sizeof(uint32_t)*2);
188 uint32_t sizebyte = record.m_record.
length1;
189 uint32_t sizeword = (sizebyte+3)/4;
190 os.write(record.m_appName.c_str(), sizeword*4);
191 os.write((
char*)(&record.m_record.
length2),
sizeof(uint32_t));
192 sizebyte = record.m_record.
length2;
193 sizeword = (sizebyte+3)/4;
194 os.write(record.m_usrTag.c_str(), sizeword*4);
195 if ( os.fail() ) {
196 std::cerr << "[RawFile] Error occurred while writing file" << std::endl;
198 }
199 return os;
200}
◆ operator>> [1/2]
Definition at line 28 of file RawFileUtil.cxx.
28 {
29
30 if (is.read((
char*)(&record.m_record.
marker),
sizeof(uint32_t)).fail()) {
31
33 }
34
35
36 if (record.m_record.
marker != 0x1234aabb) {
37
39 }
40
41
42 if (is.read((
char*)(&record.m_record.
length1),
sizeof(uint32_t)).fail()) {
43
45 }
46
47 uint32_t length1_word = (record.m_record.
length1 + 3) / 4;
48 char* appName = new char[length1_word * 4 + 1];
49 if (is.read(appName, length1_word*4).fail()) {
50
52 }
53 appName[record.m_record.
length1] =
'\0';
54 record.m_appName = appName;
55 delete[] appName;
56
57 if (is.read((
char*)(&record.m_record.
length2),
sizeof(uint32_t)).fail()) {
58
60 }
61
62 uint32_t length2_word = (record.m_record.
length2 + 3) / 4;
63 char* usrTag = new char[length2_word * 4 + 1];
64 if (is.read(usrTag, length2_word*4).fail()) {
65
67 }
68 usrTag[record.m_record.
length2] =
'\0';
69 record.m_usrTag = usrTag;
70 delete[] usrTag;
71
72 return is;
73}
◆ operator>> [2/2]
Definition at line 28 of file RawFileUtil.cxx.
28 {
29
30 if (is.read((
char*)(&record.m_record.
marker),
sizeof(uint32_t)).fail()) {
31
33 }
34
35
36 if (record.m_record.
marker != 0x1234aabb) {
37
39 }
40
41
42 if (is.read((
char*)(&record.m_record.
length1),
sizeof(uint32_t)).fail()) {
43
45 }
46
47 uint32_t length1_word = (record.m_record.
length1 + 3) / 4;
48 char* appName = new char[length1_word * 4 + 1];
49 if (is.read(appName, length1_word*4).fail()) {
50
52 }
53 appName[record.m_record.
length1] =
'\0';
54 record.m_appName = appName;
55 delete[] appName;
56
57 if (is.read((
char*)(&record.m_record.
length2),
sizeof(uint32_t)).fail()) {
58
60 }
61
62 uint32_t length2_word = (record.m_record.
length2 + 3) / 4;
63 char* usrTag = new char[length2_word * 4 + 1];
64 if (is.read(usrTag, length2_word*4).fail()) {
65
67 }
68 usrTag[record.m_record.
length2] =
'\0';
69 record.m_usrTag = usrTag;
70 delete[] usrTag;
71
72 return is;
73}
The documentation for this class was generated from the following files: