src/XMLDocumentConstructor.h
author František Kučera <franta-hg@frantovo.cz>
Sun, 07 Mar 2021 17:50:11 +0100
branchv_0
changeset 0 bfee08a31fdc
child 1 2179f13227f4
permissions -rw-r--r--
project skeleton
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
/**
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
 * Relational pipes
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
 * Copyright © 2021 František Kučera (Frantovo.cz, GlobalCode.info)
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
 *
bfee08a31fdc 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
bfee08a31fdc 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
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
 * the Free Software Foundation, version 3 of the License.
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
 *
bfee08a31fdc 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,
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
 * GNU General Public License for more details.
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
 *
bfee08a31fdc 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
bfee08a31fdc 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/>.
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
 */
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
#pragma once
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
namespace relpipe {
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    20
namespace in {
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
namespace xmltable {
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    22
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    23
#include <libxml++-2.6/libxml++/libxml++.h>
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    24
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    25
class XMLDocumentConstructor {
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    26
private:
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    27
	std::istream* input = nullptr;
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    28
	xmlpp::DomParser* parser = nullptr;
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    29
public:
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    30
bfee08a31fdc 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) {
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    32
	}
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    33
	
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    34
	void setOption(const std::string& uri, const std::string& value) {
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    35
	}
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    36
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    37
	void process() {
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    38
		parser->parse_stream(*input);
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    39
	}
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    40
};
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    41
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    42
}
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    43
}
bfee08a31fdc project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    44
}