equal
deleted
inserted
replaced
13 * |
13 * |
14 * You should have received a copy of the GNU General Public License |
14 * You should have received a copy of the GNU General Public License |
15 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
15 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 */ |
16 */ |
17 #pragma once |
17 #pragma once |
|
18 |
|
19 #include <memory> |
18 |
20 |
19 #include <libxml++-2.6/libxml++/libxml++.h> |
21 #include <libxml++-2.6/libxml++/libxml++.h> |
20 |
22 |
21 #include "lib/BasicASN1Reader.h" |
23 #include "lib/BasicASN1Reader.h" |
22 #include "lib/GenericASN1ContentHandler.h" |
24 #include "lib/GenericASN1ContentHandler.h" |
39 } |
41 } |
40 |
42 |
41 void process() { |
43 void process() { |
42 |
44 |
43 relpipe::in::asn1::lib::BasicASN1Reader reader; |
45 relpipe::in::asn1::lib::BasicASN1Reader reader; |
|
46 std::shared_ptr<relpipe::in::asn1::lib::GenericASN1ContentHandler> asn1handler = make_shared<relpipe::in::asn1::lib::GenericASN1ContentHandler>(); |
|
47 std::shared_ptr<relpipe::in::asn1::lib::DOMBuildingSAXContentHandler> saxHandler = make_shared<relpipe::in::asn1::lib::DOMBuildingSAXContentHandler>(parser->get_document()); |
|
48 |
|
49 asn1handler->addHandler(saxHandler); |
|
50 reader.addHandler(asn1handler); |
|
51 |
|
52 |
44 reader.write(nullptr, 0); // FIXME: transfer data from input to reader + use DOMBuildingSAXContentHandler |
53 reader.write(nullptr, 0); // FIXME: transfer data from input to reader + use DOMBuildingSAXContentHandler |
45 reader.close(); |
54 reader.close(); |
46 |
55 |
47 parser->parse_stream(*input); |
56 parser->parse_stream(*input); |
48 } |
57 } |