DeckOutput.hpp
Go to the documentation of this file.
1/*
2 Copyright 2017 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 DECK_OUTPUT_HPP
21#define DECK_OUTPUT_HPP
22
23#include <ostream>
24#include <string>
25#include <cstddef>
26
27namespace Opm {
28
29 class DeckOutput {
30 public:
31 explicit DeckOutput(std::ostream& s, int precision = 10);
34
35 void start_record( );
36 void end_record( );
38
39 void start_keyword(const std::string& kw);
40 void end_keyword(bool add_slash);
41
42 void endl();
43 void write_string(const std::string& s);
44 template <typename T> void write(const T& value);
45
46 std::string item_sep = " "; // Separator between items on a row.
47 size_t columns = 16; // The maximum number of columns on a record.
48 std::string record_indent = " "; // The indentation when starting a new line.
49 std::string keyword_sep = "\n\n"; // The separation between keywords;
50 private:
51 std::ostream& os;
52 size_t default_count;
53 size_t row_count;
54 bool record_on;
55 int org_precision;
56
57 template <typename T> void write_value(const T& value);
58 void write_sep( );
59 void set_precision(int precision);
60 };
61}
62
63#endif
64
const char *const string
Definition: cJSON.h:170
Definition: DeckOutput.hpp:29
void start_keyword(const std::string &kw)
void write_string(const std::string &s)
std::string item_sep
Definition: DeckOutput.hpp:46
void write(const T &value)
size_t columns
Definition: DeckOutput.hpp:47
DeckOutput(std::ostream &s, int precision=10)
std::string record_indent
Definition: DeckOutput.hpp:48
void stash_default()
void end_keyword(bool add_slash)
std::string keyword_sep
Definition: DeckOutput.hpp:49
Definition: A.hpp:4
T value(details::expression_node< T > *n)
Definition: exprtk.hpp:12955