src/XMLDocumentConstructor.h
branchv_0
changeset 1 2179f13227f4
parent 0 bfee08a31fdc
child 3 68026fe3aaf5
equal deleted inserted replaced
0:bfee08a31fdc 1:2179f13227f4
    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 
    18 
       
    19 #include <libxml++-2.6/libxml++/libxml++.h>
       
    20 
       
    21 #include "lib/BasicASN1Reader.h"
       
    22 #include "lib/GenericASN1ContentHandler.h"
       
    23 #include "lib/DOMBuildingSAXContentHandler.h"
       
    24 
    19 namespace relpipe {
    25 namespace relpipe {
    20 namespace in {
    26 namespace in {
    21 namespace xmltable {
    27 namespace xmltable {
    22 
       
    23 #include <libxml++-2.6/libxml++/libxml++.h>
       
    24 
    28 
    25 class XMLDocumentConstructor {
    29 class XMLDocumentConstructor {
    26 private:
    30 private:
    27 	std::istream* input = nullptr;
    31 	std::istream* input = nullptr;
    28 	xmlpp::DomParser* parser = nullptr;
    32 	xmlpp::DomParser* parser = nullptr;
    29 public:
    33 public:
    30 
    34 
    31 	XMLDocumentConstructor(std::istream* input, xmlpp::DomParser* parser) : input(input), parser(parser) {
    35 	XMLDocumentConstructor(std::istream* input, xmlpp::DomParser* parser) : input(input), parser(parser) {
    32 	}
    36 	}
    33 	
    37 
    34 	void setOption(const std::string& uri, const std::string& value) {
    38 	void setOption(const std::string& uri, const std::string& value) {
    35 	}
    39 	}
    36 
    40 
    37 	void process() {
    41 	void process() {
       
    42 
       
    43 		relpipe::in::asn1::lib::BasicASN1Reader reader;
       
    44 		reader.write(nullptr, 0); // FIXME: transfer data from input to reader + use DOMBuildingSAXContentHandler
       
    45 
    38 		parser->parse_stream(*input);
    46 		parser->parse_stream(*input);
    39 	}
    47 	}
    40 };
    48 };
    41 
    49 
    42 }
    50 }