FortIO.hpp
Go to the documentation of this file.
1/*
2 Copyright 2015 Equinor 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 OPM_ERT_FORTIO_KW
21#define OPM_ERT_FORTIO_KW
22
23#include <fstream>
24#include <string>
25#include <memory>
26
27#include <ert/ecl/fortio.h>
29
31
32
33
34namespace ERT {
35 class FortIO
36 {
37 public:
39 FortIO(const std::string& filename , std::ios_base::openmode mode , bool fmt_file = false , bool endian_flip_header = ECL_ENDIAN_FLIP);
40 void open(const std::string& filename , std::ios_base::openmode mode , bool fmt_file = false , bool endian_flip_header = ECL_ENDIAN_FLIP);
41 void fflush() const;
42 bool ftruncate( offset_type new_size );
43
44 fortio_type * get() const;
45 void close();
46 private:
48 };
49}
50
51
52#endif
const char *const string
Definition: cJSON.h:170
Definition: FortIO.hpp:36
FortIO(const std::string &filename, std::ios_base::openmode mode, bool fmt_file=false, bool endian_flip_header=ECL_ENDIAN_FLIP)
fortio_type * get() const
void fflush() const
void close()
bool ftruncate(offset_type new_size)
void open(const std::string &filename, std::ios_base::openmode mode, bool fmt_file=false, bool endian_flip_header=ECL_ENDIAN_FLIP)
struct fortio_struct fortio_type
Definition: include/ert/ecl/fortio.h:42
Definition: EclFilename.hpp:25
std::unique_ptr< T, deleter< T, F > > ert_unique_ptr
Definition: ert_unique_ptr.hpp:17
long offset_type
Definition: util.h:76