Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KItinerary
Commits
3c890632
Commit
3c890632
authored
Oct 21, 2022
by
Volker Krause
Browse files
Implement decoding of uPER sequences of UTF-8 strings
This also completes the FCB decoder definition.
parent
869dfc16
Pipeline
#252611
passed with stage
in 11 minutes and 10 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/lib/asn1/uperdecoder.cpp
View file @
3c890632
...
...
@@ -139,3 +139,14 @@ QList<QByteArray> UPERDecoder::readSequenceOfIA5String()
}
return
result
;
}
QList
<
QString
>
UPERDecoder
::
readSequenceOfUtf8String
()
{
const
auto
size
=
readLengthDeterminant
();
QList
<
QString
>
result
;
result
.
reserve
(
size
);
for
(
size_type
i
=
0
;
i
<
size
;
++
i
)
{
result
.
push_back
(
readUtf8String
());
}
return
result
;
}
src/lib/asn1/uperdecoder.h
View file @
3c890632
...
...
@@ -88,6 +88,7 @@ public:
QList
<
int
>
readSequenceOfConstrainedWholeNumber
(
int64_t
minimum
,
int64_t
maximum
);
QList
<
int
>
readSequenceOfUnconstrainedWholeNumber
();
QList
<
QByteArray
>
readSequenceOfIA5String
();
QList
<
QString
>
readSequenceOfUtf8String
();
/** Read enumerated value.
* @see X.691 §14
...
...
src/lib/era/fcbticket.cpp
View file @
3c890632
...
...
@@ -58,6 +58,10 @@
if (Name ## IsSet()) \
Name = decoder.readSequenceOfIA5String()
#define FCB_READ_SEQUENCE_OF_UTF8STRING(Name) \
if (Name ## IsSet()) \
Name = decoder.readSequenceOfUtf8String()
#define FCB_READ_SEQUENCE_OF_CUSTOM(Name) \
if (Name ## IsSet()) \
Name = decoder.readSequenceOf<decltype(Name)::value_type>();
...
...
@@ -673,10 +677,10 @@ void Fcb::StationPassageData::decode(UPERDecoder &decoder)
FCB_READ_ENUM
(
stationCodeTable
);
FCB_READ_SEQUENCE_OF_UNCONTRAINED_INT
(
stationNum
);
FCB_READ_SEQUENCE_OF_IA5STRING
(
stationIA5
);
// TODO stationNameUTF8
SEQUENCE
OF
UTF8S
tring OPTIONAL,
FCB_READ_
SEQUENCE
_
OF
_
UTF8S
TRING
(
stationNameUTF8
);
FCB_READ_SEQUENCE_OF_UNCONTRAINED_INT
(
areaCodeNum
);
FCB_READ_SEQUENCE_OF_IA5STRING
(
areaCodeIA5
);
// TODO areaNameUTF8
SEQUENCE
OF
UTF8S
tring OPTIONAL,
FCB_READ_
SEQUENCE
_
OF
_
UTF8S
TRING
(
areaNameUTF8
);
validFromDay
=
decoder
.
readConstrainedWholeNumber
(
-
1
,
700
);
FCB_READ_CONSTRAINED_INT
(
validFromTime
,
0
,
1440
);
FCB_READ_CONSTRAINED_INT
(
validFromUTCOffset
,
-
60
,
60
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment