equal
deleted
inserted
replaced
16 */ |
16 */ |
17 #pragma once |
17 #pragma once |
18 |
18 |
19 #include <memory> |
19 #include <memory> |
20 #include <vector> |
20 #include <vector> |
|
21 #include <array> |
21 |
22 |
22 #include "ASN1Reader.h" |
23 #include "ASN1Reader.h" |
23 |
24 |
24 namespace relpipe { |
25 namespace relpipe { |
25 namespace in { |
26 namespace in { |
41 State state = State::A; |
42 State state = State::A; |
42 |
43 |
43 bool started = false; |
44 bool started = false; |
44 |
45 |
45 void readNext() { |
46 void readNext() { |
46 char type; |
47 std::array<char, 2> typeAndLength; |
47 read(&type, 1); |
48 read(typeAndLength.data(), typeAndLength.size()); |
48 commit(); |
49 commit(); |
49 |
50 |
50 if (!started) { |
51 if (!started) { |
51 handlers.writeStreamStart(); |
52 handlers.writeStreamStart(); |
52 started = true; |
53 started = true; |
53 } |
54 } |
54 |
55 |
55 handlers.writeCollectionStart(ASN1ContentHandler::CollectionType::Sequence); |
56 handlers.writeCollectionStart(ASN1ContentHandler::CollectionType::Sequence); |
56 handlers.writeNull(); |
57 handlers.writeNull(); |
57 handlers.writeBoolean(true); |
58 handlers.writeBoolean(true); |
58 handlers.writeInteger(type); |
59 handlers.writeInteger(typeAndLength[0]); |
|
60 handlers.writeInteger(typeAndLength[1]); |
59 handlers.writeString(ASN1ContentHandler::StringType::UTF8String, "relational pipes"); |
61 handlers.writeString(ASN1ContentHandler::StringType::UTF8String, "relational pipes"); |
60 handlers.writeCollectionEnd(); |
62 handlers.writeCollectionEnd(); |
61 |
63 |
62 if (state == State::A) { |
64 if (state == State::A) { |
63 |
65 |