Toggle navigation
Documentation
Big picture
The finite element method
The data structure
Not-so-quick guide
Optimisation
Order of action functions
Example codes and tutorials
List of example codes and tutorials
Meshing
Solvers
MPI parallel processing
Post-processing/visualisation
Other
Change log
Creating documentation
Coding conventions
Index
FAQ
About
People
Contact/Get involved
Publications
Acknowledgements
Copyright
Picture show
Go
src
generic
gzip_reader.h
Go to the documentation of this file.
1
// LIC// ====================================================================
2
// LIC// This file forms part of oomph-lib, the object-oriented,
3
// LIC// multi-physics finite-element library, available
4
// LIC// at http://www.oomph-lib.org.
5
// LIC//
6
// LIC// Copyright (C) 2006-2025 Matthias Heil and Andrew Hazel
7
// LIC//
8
// LIC// This library is free software; you can redistribute it and/or
9
// LIC// modify it under the terms of the GNU Lesser General Public
10
// LIC// License as published by the Free Software Foundation; either
11
// LIC// version 2.1 of the License, or (at your option) any later version.
12
// LIC//
13
// LIC// This library is distributed in the hope that it will be useful,
14
// LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
15
// LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
// LIC// Lesser General Public License for more details.
17
// LIC//
18
// LIC// You should have received a copy of the GNU Lesser General Public
19
// LIC// License along with this library; if not, write to the Free Software
20
// LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21
// LIC// 02110-1301 USA.
22
// LIC//
23
// LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
24
// LIC//
25
// LIC//====================================================================
26
27
#ifndef OOMPH_GZIP_READER_HEADER
28
#define OOMPH_GZIP_READER_HEADER
29
30
#include "oomph_zlib/zlib.h"
31
32
#include <string>
33
#include <memory>
34
#include <vector>
35
36
namespace
oomph
37
{
38
/************************************************************************************
39
* @brief
40
*
41
************************************************************************************/
42
struct
Packet
43
{
44
std::string
data
;
45
bool
found
;
46
};
47
48
/************************************************************************************
49
* @brief
50
*
51
* @tparam _CharT
52
* @tparam _Traits
53
************************************************************************************/
54
class
GZipReader
55
{
56
public
:
57
GZipReader
();
58
GZipReader
(
const
std::string&
filename
,
const
unsigned
&
chunk_size
= 256);
59
~GZipReader
();
60
void
open
(
const
std::string&
filename
);
61
void
close
();
62
bool
is_open
()
const
;
63
Packet
getline
();
64
std::vector<std::string>
read_all
();
65
66
private
:
67
gzFile
Gzip_file
;
68
unsigned
Chunk_size
;
69
};
70
71
}
// namespace oomph
72
73
#endif
oomph::GZipReader
Definition
gzip_reader.h:55
oomph::GZipReader::Gzip_file
gzFile Gzip_file
Definition
gzip_reader.h:67
oomph::GZipReader::read_all
std::vector< std::string > read_all()
Definition
gzip_reader.cc:180
oomph::GZipReader::open
void open(const std::string &filename)
Definition
gzip_reader.cc:78
oomph::GZipReader::GZipReader
GZipReader()
Definition
gzip_reader.cc:41
oomph::GZipReader::getline
Packet getline()
Definition
gzip_reader.cc:119
oomph::GZipReader::is_open
bool is_open() const
Definition
gzip_reader.cc:103
oomph::GZipReader::close
void close()
Definition
gzip_reader.cc:87
oomph::GZipReader::~GZipReader
~GZipReader()
Definition
gzip_reader.cc:65
oomph::GZipReader::Chunk_size
unsigned Chunk_size
Definition
gzip_reader.h:68
oomph::TAdvectionDiffusionReactionElement
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
Definition
Tadvection_diffusion_reaction_elements.h:66
oomph
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition
advection_diffusion_elements.cc:30
oomph::Packet
Definition
gzip_reader.h:43
oomph::Packet::found
bool found
Definition
gzip_reader.h:45
oomph::Packet::data
std::string data
Definition
gzip_reader.h:44