menu: added new Keywords tag to .desktop files
[barry.git] / src / pipe.h
blobe34443808833538c100b3f56e5ca9669fc8e7a6f
1 ///
2 /// \file pipe.h
3 /// Connector class to join parsers and builders together
4 ///
6 /*
7 Copyright (C) 2010-2013, Net Direct Inc. (http://www.netdirect.ca/)
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU General Public License in the COPYING file at the
19 root directory of this project for more details.
22 #ifndef __BARRY_PIPE_H__
23 #define __BARRY_PIPE_H__
25 #include "dll.h"
26 #include "builder.h"
27 #include "parser.h"
29 namespace Barry {
32 // class Pipe
34 /// Reads data from a builder and feeds it into a parser.
35 ///
36 class BXEXPORT Pipe
38 Builder &m_builder;
40 DBData m_buffer;
42 public:
43 explicit Pipe(Builder &builder);
44 ~Pipe();
46 /// Access the builder... mostly useful for finding out
47 /// the database name for the next series, if using multiple
48 /// parser objects.
49 const Builder& GetBuilder() const { return m_builder; }
51 /// Reads one item from the builder and feeds it into the parser
52 /// and returns the builder Retrieve status.
53 bool PumpEntry(Parser &parser, const IConverter *ic = 0);
55 /// Reads all items from builder, feeding them into the parser,
56 /// until the builder's Retrieve() signals the end of the series.
57 void PumpSeries(Parser &parser, const IConverter *ic = 0);
59 /// Reads all series from the builder, feeding them into the parser,
60 /// until the builder's EndOfFile() is true.
61 void PumpFile(Parser &parser, const IConverter *ic = 0);
64 } // namespace Barry
66 #endif