28 {
29
30 if (is.read((
char*)(&record.m_record.
marker),
sizeof(uint32_t)).fail()) {
31
32 throw BadInputStream("FileNameStrings::marker");
33 }
34
35
36 if (record.m_record.
marker != 0x1234aabb) {
37
38 throw WrongMarker(0x1234aabb, record.m_record.
marker);
39 }
40
41
42 if (is.read((
char*)(&record.m_record.
length1),
sizeof(uint32_t)).fail()) {
43
44 throw BadInputStream("FileNameStrings::length1");
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
51 throw BadInputStream("FileNameStrings::appName");
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
59 throw BadInputStream("FileNameStrings::length2");
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
66 throw BadInputStream("FileNameStrings::usrTag");
67 }
68 usrTag[record.m_record.
length2] =
'\0';
69 record.m_usrTag = usrTag;
70 delete[] usrTag;
71
72 return is;
73}