author | František Kučera <franta-hg@frantovo.cz> |
Tue, 22 Jun 2021 21:41:59 +0200 | |
branch | v_0 |
changeset 16 | bb457bb5b515 |
parent 15 | 95ca127ba816 |
child 17 | f5281ab3e68f |
permissions | -rw-r--r-- |
1
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
1 |
/** |
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
2 |
* Relational pipes |
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
3 |
* Copyright © 2021 František Kučera (Frantovo.cz, GlobalCode.info) |
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
4 |
* |
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
5 |
* This program is free software: you can redistribute it and/or modify |
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License as published by |
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
7 |
* the Free Software Foundation, version 3 of the License. |
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
8 |
* |
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
13 |
* |
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
15 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
16 |
*/ |
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
17 |
#pragma once |
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
18 |
|
4
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
19 |
#include <memory> |
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
20 |
#include <vector> |
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
21 |
|
1
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
22 |
namespace relpipe { |
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
23 |
namespace in { |
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
24 |
namespace asn1 { |
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
25 |
namespace lib { |
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
26 |
|
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
27 |
class ASN1ContentHandler { |
4
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
28 |
public: |
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
29 |
|
14
02725d301010
somehow parse nested SEQUENCEs and SETs + support definite long form of lengths (multiple length octets)
František Kučera <franta-hg@frantovo.cz>
parents:
9
diff
changeset
|
30 |
enum class CollectionType : uint64_t { |
15
95ca127ba816
support constructed (like a collection)
František Kučera <franta-hg@frantovo.cz>
parents:
14
diff
changeset
|
31 |
Constructed, // TODO: special event? |
14
02725d301010
somehow parse nested SEQUENCEs and SETs + support definite long form of lengths (multiple length octets)
František Kučera <franta-hg@frantovo.cz>
parents:
9
diff
changeset
|
32 |
Sequence = 16, |
02725d301010
somehow parse nested SEQUENCEs and SETs + support definite long form of lengths (multiple length octets)
František Kučera <franta-hg@frantovo.cz>
parents:
9
diff
changeset
|
33 |
Set = 17 |
8
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
34 |
}; |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
35 |
|
14
02725d301010
somehow parse nested SEQUENCEs and SETs + support definite long form of lengths (multiple length octets)
František Kučera <franta-hg@frantovo.cz>
parents:
9
diff
changeset
|
36 |
enum class StringType : uint64_t { |
8
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
37 |
OctetString, |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
38 |
UTF8String, |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
39 |
NumericString, |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
40 |
PrintableString, |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
41 |
T61String, |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
42 |
VideotexString, |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
43 |
IA5String, |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
44 |
GraphicString, |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
45 |
VisibleString, |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
46 |
GeneralString, |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
47 |
UniversalString, |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
48 |
CharacterString, |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
49 |
BMPString, |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
50 |
}; |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
51 |
|
4
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
52 |
virtual ~ASN1ContentHandler() = default; |
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
53 |
|
9
7a6abdd00ab5
partial implementation of DOMBuildingXMLContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
8
diff
changeset
|
54 |
virtual void writeStreamStart() = 0; |
7a6abdd00ab5
partial implementation of DOMBuildingXMLContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
8
diff
changeset
|
55 |
virtual void writeStreamEnd() = 0; |
7a6abdd00ab5
partial implementation of DOMBuildingXMLContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
8
diff
changeset
|
56 |
|
8
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
57 |
virtual void writeCollectionStart(CollectionType type) = 0; |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
58 |
virtual void writeCollectionEnd() = 0; |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
59 |
virtual void writeBoolean(bool value) = 0; |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
60 |
virtual void writeNull() = 0; |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
61 |
virtual void writeInteger(int64_t value) = 0; |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
62 |
virtual void writeString(StringType type, std::string value) = 0; |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
63 |
// virtual void writeOID(std::string value) = 0; |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
64 |
// Object descriptor |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
65 |
// virtual void writeReal(float value) = 0; |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
66 |
// Enumerated |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
67 |
// Embedded PVD |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
68 |
// Relative OID |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
69 |
// TIME |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
70 |
// UTC time |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
71 |
// Generalized time |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
72 |
// Date |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
73 |
// Time of day |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
74 |
// Date-time |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
75 |
// Duration |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
76 |
// OID-IRI |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
77 |
// Relative OID-IRI |
4
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
78 |
|
1
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
79 |
}; |
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
80 |
|
4
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
81 |
class ASN1ContentHandlerProxy : public ASN1ContentHandler { |
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
82 |
private: |
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
83 |
std::vector<std::shared_ptr<ASN1ContentHandler>> handlers; |
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
84 |
public: |
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
85 |
|
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
86 |
void addHandler(std::shared_ptr<ASN1ContentHandler> handler) { |
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
87 |
handlers.push_back(handler); |
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
88 |
} |
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
89 |
|
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
90 |
#define handler for (auto ___h : handlers) ___h |
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
91 |
|
9
7a6abdd00ab5
partial implementation of DOMBuildingXMLContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
8
diff
changeset
|
92 |
void writeStreamStart() override { |
7a6abdd00ab5
partial implementation of DOMBuildingXMLContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
8
diff
changeset
|
93 |
handler->writeStreamStart(); |
7a6abdd00ab5
partial implementation of DOMBuildingXMLContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
8
diff
changeset
|
94 |
} |
7a6abdd00ab5
partial implementation of DOMBuildingXMLContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
8
diff
changeset
|
95 |
|
7a6abdd00ab5
partial implementation of DOMBuildingXMLContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
8
diff
changeset
|
96 |
void writeStreamEnd() override { |
7a6abdd00ab5
partial implementation of DOMBuildingXMLContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
8
diff
changeset
|
97 |
handler->writeStreamEnd(); |
7a6abdd00ab5
partial implementation of DOMBuildingXMLContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
8
diff
changeset
|
98 |
} |
7a6abdd00ab5
partial implementation of DOMBuildingXMLContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
8
diff
changeset
|
99 |
|
7a6abdd00ab5
partial implementation of DOMBuildingXMLContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
8
diff
changeset
|
100 |
void writeCollectionStart(CollectionType type) override { |
8
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
101 |
handler->writeCollectionStart(type); |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
102 |
} |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
103 |
|
9
7a6abdd00ab5
partial implementation of DOMBuildingXMLContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
8
diff
changeset
|
104 |
void writeCollectionEnd() override { |
8
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
105 |
handler->writeCollectionEnd(); |
4
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
106 |
} |
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
107 |
|
9
7a6abdd00ab5
partial implementation of DOMBuildingXMLContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
8
diff
changeset
|
108 |
void writeBoolean(bool value) override { |
8
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
109 |
handler->writeBoolean(value); |
4
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
110 |
} |
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
111 |
|
9
7a6abdd00ab5
partial implementation of DOMBuildingXMLContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
8
diff
changeset
|
112 |
void writeNull() override { |
8
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
113 |
handler->writeNull(); |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
114 |
} |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
115 |
|
16
bb457bb5b515
some support for UTF8String and PrintableString
František Kučera <franta-hg@frantovo.cz>
parents:
15
diff
changeset
|
116 |
void writeInteger(int64_t value) override { // TODO: Integer class containing raw data + methods for converting them to particular numeric data types |
8
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
117 |
handler->writeInteger(value); |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
118 |
} |
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
119 |
|
9
7a6abdd00ab5
partial implementation of DOMBuildingXMLContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
8
diff
changeset
|
120 |
void writeString(StringType type, std::string value) override { |
8
d37c1a5d09ce
bit more meaningful methods in ASN1ContentHandler
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
121 |
handler->writeString(type, value); |
4
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
122 |
} |
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
123 |
|
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
124 |
#undef handler |
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
125 |
|
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
126 |
}; |
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
127 |
|
7230e1ea0b07
proxy handlers forwarding events to all subordinate handlers
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
128 |
|
1
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
129 |
} |
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
130 |
} |
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
131 |
} |
2179f13227f4
AbstractParser: AbstractParser, ASN1Reader, ASN1ContentHandler, SAXContentHandler, BasicASN1Reader, DOMBuildingSAXContentHandler, GenericASN1ContentHandler skeletons
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
132 |
} |