src/XMLDocumentConstructor.h
author František Kučera <franta-hg@frantovo.cz>
Sat, 20 Feb 2021 20:32:56 +0100
branchv_0
changeset 0 2f783f0573fa
child 1 db5418b04c63
permissions -rw-r--r--
project skeleton
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
/**
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
 * Relational pipes
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
 * Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
 *
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
 * This program is free software: you can redistribute it and/or modify
2f783f0573fa project skeleton
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
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
 * the Free Software Foundation, version 3 of the License.
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
 *
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
 * GNU General Public License for more details.
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
 *
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
 */
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
#pragma once
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
namespace relpipe {
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    20
namespace in {
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
namespace xmltable {
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    22
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    23
#include <libxml++-2.6/libxml++/libxml++.h>
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    24
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    25
class XMLDocumentConstructor {
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    26
private:
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    27
	std::istream* input = nullptr;
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    28
	xmlpp::DomParser* parser = nullptr;
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    29
public:
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    30
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    31
	XMLDocumentConstructor(std::istream* input, xmlpp::DomParser* parser) : input(input), parser(parser) {
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    32
	}
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    33
	
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    34
	void setOption(const std::string& uri, const std::string& value) {
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    35
	}
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    36
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    37
	void process() {
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    38
		parser->parse_stream(*input);
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    39
	}
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    40
};
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    41
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    42
}
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    43
}
2f783f0573fa project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    44
}