ParserRecord.hpp
Go to the documentation of this file.
1/*
2 Copyright 2013 Statoil ASA.
3
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef PARSERRECORD_HPP
21#define PARSERRECORD_HPP
22
23#include <iosfwd>
24#include <vector>
25#include <memory>
26
28
29namespace Opm {
30
31 class Deck;
32 class DeckRecord;
33 class ParseContext;
34 class ParserItem;
35 class RawRecord;
36 class ErrorGuard;
37 class UnitSystem;
38
40 public:
42 size_t size() const;
45 const ParserItem& get(size_t index) const;
46 const ParserItem& get(const std::string& itemName) const;
47 DeckRecord parse( const ParseContext&, ErrorGuard&, RawRecord&, UnitSystem& active_unitsystem, UnitSystem& default_unitsystem, const std::string& keyword, const std::string& filename) const;
48 bool isDataRecord() const;
49 bool equal(const ParserRecord& other) const;
50 bool hasDimension() const;
51 bool hasItem(const std::string& itemName) const;
52 std::vector< ParserItem >::const_iterator begin() const;
53 std::vector< ParserItem >::const_iterator end() const;
54
55 bool operator==( const ParserRecord& ) const;
56 bool operator!=( const ParserRecord& ) const;
57 bool rawStringRecord() const;
58 const std::string& end_string() const;
59
60 private:
61 bool m_dataRecord;
62 std::vector< ParserItem > m_items;
63 bool raw_string_record = false;
64 std::string record_end = "/";
65 };
66
67std::ostream& operator<<( std::ostream&, const ParserRecord& );
68}
69
70
71#endif /* PARSERRECORD_HPP */
72
int index
Definition: cJSON.h:168
cJSON * item
Definition: cJSON.h:218
const char *const string
Definition: cJSON.h:170
Definition: DeckRecord.hpp:32
Definition: ErrorGuard.hpp:29
Definition: ParseContext.hpp:84
Definition: ParserItem.hpp:61
Definition: ParserRecord.hpp:39
bool hasDimension() const
std::vector< ParserItem >::const_iterator end() const
const std::string & end_string() const
const ParserItem & get(size_t index) const
bool operator!=(const ParserRecord &) const
bool equal(const ParserRecord &other) const
std::vector< ParserItem >::const_iterator begin() const
void addItem(ParserItem)
bool operator==(const ParserRecord &) const
bool isDataRecord() const
size_t size() const
DeckRecord parse(const ParseContext &, ErrorGuard &, RawRecord &, UnitSystem &active_unitsystem, UnitSystem &default_unitsystem, const std::string &keyword, const std::string &filename) const
const ParserItem & get(const std::string &itemName) const
bool rawStringRecord() const
void addDataItem(ParserItem item)
bool hasItem(const std::string &itemName) const
Definition: RawRecord.hpp:36
Definition: UnitSystem.hpp:32
UDAKeyword keyword(UDAControl control)
Definition: A.hpp:4
std::ostream & operator<<(std::ostream &os, const UniformTableLinear< T > &t)
Definition: UniformTableLinear.hpp:249