KItinerary
6#ifndef KITINERARY_UPERDECODER_H
7#define KITINERARY_UPERDECODER_H
9#include "bitvectorview.h"
22 using size_type = BitVectorView::size_type;
24 size_type offset()
const;
25 void seek(size_type index);
64 template <std::
size_t N>
67 auto result = m_data.bitsetAt<N>(m_idx);
81 for (size_type i = 0; i < size; ++i) {
83 element.decode(*
this);
88 QList<int> readSequenceOfConstrainedWholeNumber(int64_t minimum, int64_t maximum);
89 QList<int> readSequenceOfUnconstrainedWholeNumber();
101 return static_cast<T
>(me.value(idx));
103 template <
typename T>
104 inline T readEnumeratedWithExtensionMarker()
107 setError(
"CHOICE with extension marker set not implemented.");
116 template <
typename... Ts>
120 setError(
"CHOICE with extension marker set not implemented.");
123 constexpr auto count =
sizeof...(Ts);
125 if (choiceIdx > (
int)count) {
129 return readChoiceElement<Ts...>(choiceIdx);
145 template <
typename T,
typename T1,
typename... Ts>
146 inline QVariant readChoiceElement(
int choiceIdx)
148 if (choiceIdx == 0) {
149 return readChoiceElement<T>(choiceIdx);
151 return readChoiceElement<T1, Ts...>(choiceIdx - 1);
153 template <
typename T>
154 inline QVariant readChoiceElement([[maybe_unused]]
int choiceIdx)
156 assert(choiceIdx == 0);
162 BitVectorView m_data;
163 size_type m_idx = {};
Non-owning bit-level view for working with data that isn't byte-aligned.
QList< T > readSequenceOf()
Read a sequence-of field with unrestricted size.
T readEnumerated()
Read enumerated value.
int64_t readUnconstrainedWholeNumber()
Read unconstrained whole number.
void setError(const char *msg)
Put the decoder into the error state.
QString readUtf8String()
Read UTF-8 string.
QVariant readChoiceWithExtensionMarker()
Read a choice value.
QByteArray readOctetString()
Read unconstrained octet string (8 bit data).
bool readBoolean()
Read boolean value.
bool hasError() const
Reading at any point encountered an error.
QByteArray readIA5String()
Read an unconstrained IA5String (7 bit ASCII).
size_type readLengthDeterminant()
Read length determinant.
std::bitset< N > readBitset()
Read an.
int64_t readConstrainedWholeNumber(int64_t minimum, int64_t maximum)
Read constrained whole number from the current position.
Classes for reservation/travel data models, data extraction and data augmentation.
void push_back(parameter_type value)
void reserve(qsizetype size)
QVariant fromValue(T &&value)
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:52:35 by
doxygen 1.13.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.