10 #ifndef MAPPEDIOSTREAM_H_
11 #define MAPPEDIOSTREAM_H_
41 bool seek(
unsigned int location );
68 return write( buffer, strlen( buffer ) );
75 bool open(
bool clobber );
const Str & getFilename()
Definition: MappedIOStream.h:55
virtual IOStream & write(const char *buffer)
writes zero-terminated buffer to the output buffer/stream
Definition: MappedIOStream.h:66
This is a rather abstract class that can be implemented by classes that want to send and receive stre...
Definition: IOStream.h:30
bool seek(unsigned int location)
Definition: MappedIOStream.cpp:66
const char * getName()
returns name of the stream
Definition: MappedIOStream.h:50
virtual bool eof()
Indicates if the end of file has been reached.
Definition: MappedIOStream.cpp:75
size_t chunkSize_
Definition: MappedIOStream.h:88
virtual ~MappedIOStream()
Definition: MappedIOStream.cpp:32
size_t size_
Definition: MappedIOStream.h:89
Contains the IOStream and NullIOStream class declarations.
bool isWritable()
indicates whether the stream can actually be written to.
Definition: MappedIOStream.h:77
int tell()
Definition: MappedIOStream.cpp:103
const struct stat getStat()
Definition: MappedIOStream.cpp:84
size_t pos_
Definition: MappedIOStream.h:91
void close()
Definition: MappedIOStream.cpp:112
Replacement for standard template class string.
Definition: Str.h:12
int file_
Definition: MappedIOStream.h:86
const char * cStr() const
Definition: Str.h:188
Str filename_
Definition: MappedIOStream.h:87
bool open(bool clobber)
Definition: MappedIOStream.cpp:140
unsigned char * ptr_
Definition: MappedIOStream.h:90
bool isReadable()
indicates whether the stream can actually be read from.
Definition: MappedIOStream.h:45
virtual IOStream & read(char *buffer, size_t num)
reads num bytes from buffer to the output buffer/stream
Definition: MappedIOStream.cpp:38
void flush()
Definition: MappedIOStream.cpp:132
bool checkSize(size_t num)
Definition: MappedIOStream.cpp:49
IOStream & write(const char *buffer, size_t num)
writes num bytes from buffer to the output buffer/stream
Definition: MappedIOStream.cpp:92
Wraps Memory mapped file with an IOStream class.
Definition: MappedIOStream.h:27
MappedIOStream(const Str &filename, bool clobber, size_t chunkSize)
Constructor.
Definition: MappedIOStream.cpp:21