45 MHERROR(
"Unexpected end of file");
58 MHERROR(
"Indefinite length strings are not implemented");
61 int nLength = endStr -
m_p;
62 std::vector<uint8_t> stringValue;
63 stringValue.reserve(nLength + 1);
77 bool firstByte =
true;
81 MHERROR(
"Indefinite length integers are not implemented");
90 if (firstByte && ch >= 128)
97 intVal = (intVal << 8) | ch;
108 enum : std::uint8_t { Universal, Context } tagClass = Universal;
111 unsigned int tagNumber = 0;
122 tagClass = Universal;
128 MHERROR(QString(
"Invalid tag class = %1").arg(ch, 0, 16));
133 tagNumber = ch & 0x1f;
135 if (tagNumber == 0x1f)
138 tagNumber = ch & 0x7f;
139 while ((ch & 0x80) != 0)
142 tagNumber = (tagNumber << 7) | (ch & 0x7f);
153 int lengthOfLength = ch & 0x7f;
155 if (lengthOfLength == 0)
163 while (lengthOfLength--)
166 endOfItem = (endOfItem << 8) | ch;
174 endOfItem = ch +
m_p;
177 if (tagClass == Context)
201 if (
m_p != endOfItem)
204 pNode->AddArg(
new MHPBool(intVal != 0));
222 if (
m_p != endOfItem)
225 pNode->AddArg(
new MHPEnum(intVal));
258 if (
m_p != endOfItem)
261 pNode->AddArg(
new MHPInt(intVal));
289 MHERROR(
"Indefinite length arguments are not implemented");
292 while (
m_p < endOfItem)
317 return new MHPBool(intVal != 0);
322 return new MHPInt(intVal);
345 MHERROR(
"Indefinite length sequences are not implemented");
350 while (
m_p < endOfItem)
365 MHERROR(QString(
"Unknown universal %1").arg(tagNumber));
@ C_PROGRAM_CONNECTION_TAG
@ C_HORIZONTAL_JUSTIFICATION
@ C_CONTENT_CACHE_PRIORITY
@ C_VERTICAL_JUSTIFICATION
@ C_LINE_ART_CONTENT_HOOK
@ C_ORIGINAL_TRANSPARENCY
@ C_BORDERED_BOUNDING_BOX
static constexpr int INDEFINITE_LENGTH
void Copy(const MHOctetString &str)
void ParseString(int endStr, MHOctetString &str)
unsigned char GetNextChar()