7#include "uic9183utils.h"
8#include "uic9183block.h"
15int Uic9183Utils::readAsciiEncodedNumber(
const char* data,
int size,
int offset,
int length)
17 if (!data || offset < 0 || length < 1 || size < 1 || offset + length > size) {
18 qCWarning(
Log) <<
"Invalid UIC 918.3 read" << offset << length << size;
23 for (
int i = 0; i < length; ++i) {
25 v += (*(data + offset + i)) -
'0';
30int Uic9183Utils::readAsciiEncodedNumber(
const QByteArray &data,
int offset,
int length)
32 return readAsciiEncodedNumber(data.
constData(), data.
size(), offset, length);
35int Uic9183Utils::readAsciiEncodedNumber(
const Uic9183Block &block,
int offset,
int length)
40QString Uic9183Utils::readUtf8String(
const char* data,
int size,
int offset,
int length)
46 if (!data || offset < 0 || length < 1 || size < 1 || offset + length > size) {
47 qCWarning(
Log) <<
"Invalid UIC 918.3 read" << offset << length << size;
54QString Uic9183Utils::readUtf8String(
const QByteArray& data,
int offset,
int length)
56 return readUtf8String(data.
constData(), data.
size(), offset, length);
A data block from a UIC 918.3 ticket.
int contentSize() const
Returns the size of the content data.
const char * content() const
Returns the payload data (not including the block header).
Classes for reservation/travel data models, data extraction and data augmentation.
const char * constData() const const
qsizetype size() const const
QString fromUtf8(QByteArrayView str)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 4 2024 12:00:26 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.