Binary buffered file output.
More...
#include <JGZFileStreamIO.hh>
Binary buffered file output.
Definition at line 93 of file JGZFileStreamIO.hh.
◆ JGZFileStreamWriter() [1/2]
| JIO::JGZFileStreamWriter::JGZFileStreamWriter |
( |
| ) |
|
|
inline |
Default constructor.
Definition at line 107 of file JGZFileStreamIO.hh.
107 :
110 {}
JBufferedWriter(JWriter *__out, const int __size=1048576)
Constructor.
◆ JGZFileStreamWriter() [2/2]
| JIO::JGZFileStreamWriter::JGZFileStreamWriter |
( |
const char * | file_name, |
|
|
const int | size = 1048576 ) |
|
inline |
Constructor.
- Parameters
-
| file_name | file name |
| size | size of internal buffer |
Definition at line 119 of file JGZFileStreamIO.hh.
120 :
123 {
125 }
int size
size of internal buffer
void open(const char *file_name)
Open file.
◆ open() [1/2]
| void JIO::JGZFileStreamWriter::open |
( |
const char * | file_name | ) |
|
|
inline |
Open file.
- Parameters
-
Definition at line 133 of file JGZFileStreamIO.hh.
134 {
135 static_cast<ogzstream*
>(
this)->
open(file_name, std::ios::out & std::ios::binary);
136 }
◆ close()
| void JIO::JGZFileStreamWriter::close |
( |
| ) |
|
|
inline |
Close file.
Definition at line 142 of file JGZFileStreamIO.hh.
143 {
146 }
void flush()
Write internal data to output.
◆ operator!()
| bool JLANG::JAbstractObjectStatus::operator! |
( |
| ) |
const |
|
inline |
Negated status of this object.
- Returns
- negated status of this object
Definition at line 44 of file JAbstractObjectStatus.hh.
45 {
47 }
virtual bool getStatus() const override
Status of writer.
◆ operator<<() [1/17]
Write serialisable data object.
- Parameters
-
| object | serialisable data object |
- Returns
- JWriter
Definition at line 146 of file JSerialisable.hh.
147 {
148 return object.write(*this);
149 }
◆ operator<<() [2/17]
| JWriter & JIO::JWriter::operator<< |
( |
const bool | value | ) |
|
|
inline |
Definition at line 152 of file JSerialisable.hh.
152{
write((
const char*) &value,
sizeof(
bool));
return *
this; }
virtual int write(const char *zbuf, int n) override
Write byte array.
◆ operator<<() [3/17]
| JWriter & JIO::JWriter::operator<< |
( |
const char | value | ) |
|
|
inline |
◆ operator<<() [4/17]
| JWriter & JIO::JWriter::operator<< |
( |
const unsigned char | value | ) |
|
|
inline |
Definition at line 154 of file JSerialisable.hh.
154{
write((
const char*) &value,
sizeof(
unsigned char));
return *
this; }
◆ operator<<() [5/17]
| JWriter & JIO::JWriter::operator<< |
( |
const short | value | ) |
|
|
inline |
◆ operator<<() [6/17]
| JWriter & JIO::JWriter::operator<< |
( |
const unsigned short | value | ) |
|
|
inline |
Definition at line 156 of file JSerialisable.hh.
156{
write((
const char*) &value,
sizeof(
unsigned short));
return *
this; }
◆ operator<<() [7/17]
| JWriter & JIO::JWriter::operator<< |
( |
const int | value | ) |
|
|
inline |
◆ operator<<() [8/17]
| JWriter & JIO::JWriter::operator<< |
( |
const unsigned int | value | ) |
|
|
inline |
Definition at line 158 of file JSerialisable.hh.
158{
write((
const char*) &value,
sizeof(
unsigned int));
return *
this; }
◆ operator<<() [9/17]
| JWriter & JIO::JWriter::operator<< |
( |
const long int | value | ) |
|
|
inline |
◆ operator<<() [10/17]
| JWriter & JIO::JWriter::operator<< |
( |
const unsigned long int | value | ) |
|
|
inline |
Definition at line 160 of file JSerialisable.hh.
160{
write((
const char*) &value,
sizeof(
unsigned long int));
return *
this; }
◆ operator<<() [11/17]
| JWriter & JIO::JWriter::operator<< |
( |
const long long int | value | ) |
|
|
inline |
Definition at line 161 of file JSerialisable.hh.
161{
write((
const char*) &value,
sizeof(
long long int));
return *
this; }
◆ operator<<() [12/17]
| JWriter & JIO::JWriter::operator<< |
( |
const unsigned long long int | value | ) |
|
|
inline |
Definition at line 162 of file JSerialisable.hh.
162{
write((
const char*) &value,
sizeof(
unsigned long long int));
return *
this; }
◆ operator<<() [13/17]
| JWriter & JIO::JWriter::operator<< |
( |
const float | value | ) |
|
|
inline |
◆ operator<<() [14/17]
| JWriter & JIO::JWriter::operator<< |
( |
const double | value | ) |
|
|
inline |
◆ operator<<() [15/17]
| JWriter & JIO::JWriter::operator<< |
( |
const long double | value | ) |
|
|
inline |
◆ operator<<() [16/17]
Definition at line 166 of file JSerialisable.hh.
166{
return (*
this) << value.
getID(); }
int getID() const
Get identifier.
◆ operator<<() [17/17]
Definition at line 167 of file JSerialisable.hh.
status_type getStatus(const JType< status_type > &type) const
Get status.
◆ open() [2/2]
| void ogzstream::open |
( |
const char * | name, |
|
|
int | open_mode = std::ios::out ) |
|
inlineinherited |
Definition at line 218 of file gzstream.h.
218 {
220 }
void open(const char *name, int open_mode)
◆ rdbuf()
◆ is_open()
| bool gzstreambase::is_open |
( |
| ) |
const |
|
inlineinherited |
◆ getStatus()
| virtual bool JIO::JBufferedWriter::getStatus |
( |
| ) |
const |
|
inlineoverridevirtualinherited |
◆ write()
| virtual int JIO::JBufferedWriter::write |
( |
const char * | zbuf, |
|
|
int | n ) |
|
inlineoverridevirtualinherited |
Write byte array.
- Parameters
-
| zbuf | pointer to byte array |
| n | number of bytes |
- Returns
- number of bytes
Implements JLANG::JBinaryOutput.
Definition at line 201 of file JBufferedIO.hh.
202 {
203 for (
int i = 0; i !=
n; ) {
204
206
208
210
213 }
214 }
215
217
218 i += m;
220 }
221
223 }
char * buffer
internal buffer
int pos
pointer to end of buffered data
◆ flush()
| void JIO::JBufferedWriter::flush |
( |
| ) |
|
|
inlineinherited |
◆ store() [1/2]
Write object.
- Parameters
-
- Returns
- this writer
Definition at line 176 of file JSerialisable.hh.
177 {
178 return object.write(*this);
179 }
◆ store() [2/2]
template<class T >
| JWriter & JIO::JWriter::store |
( |
const T & | object | ) |
|
|
inlineinherited |
Write object.
- Parameters
-
- Returns
- this writer
Definition at line 189 of file JSerialisable.hh.
190 {
191 return *this << object;
192 }
◆ operator bool()
| JLANG::JAbstractObjectStatus::operator bool |
( |
| ) |
const |
|
inlineinherited |
Type conversion operator.
- Returns
- status of this object
Definition at line 33 of file JAbstractObjectStatus.hh.
34 {
36 }
virtual bool getStatus() const =0
Get status of object.
◆ buf
◆ out
◆ buffer
| char* JIO::JBufferedWriter::buffer |
|
protectedinherited |
◆ size
| int JIO::JBufferedWriter::size |
|
protectedinherited |
◆ pos
| int JIO::JBufferedWriter::pos |
|
protectedinherited |
The documentation for this class was generated from the following file: