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