◆ get_byte()
int StdioIn::get_byte |
( |
| ) |
|
|
virtual |
Reads one byte from the input stream.
- Returns
- the byte if successful, or EOF on end of file
Implements SpectMorph::GenericIn.
◆ get_pos()
size_t StdioIn::get_pos |
( |
| ) |
|
|
virtual |
◆ mmap_mem()
unsigned char * StdioIn::mmap_mem |
( |
size_t & |
remaining | ) |
|
|
virtual |
Try to access the memory of a memory-based input stream. This will fail for streams that are not memory mapped. This function is useful because it allows writing faster code than with read(); however, an alternative way of reading the data must be used if this function fails.
- Parameters
-
remaining | is set to the number to the number of bytes that are available |
- Returns
- pointer to the memory, or NULL if input is not memory mapped
Implements SpectMorph::GenericIn.
◆ open_subfile()
GenericIn * StdioIn::open_subfile |
( |
size_t |
pos, |
|
|
size_t |
len |
|
) |
| |
|
virtual |
Open a new input stream that contains a part of the original file.
- Parameters
-
pos | start position in the input stream (offset like get_pos()) |
len | length of the new subfile object |
- Returns
- a GenericIn object with the subfile or NULL on error (open failed)
Implements SpectMorph::GenericIn.
◆ read()
int StdioIn::read |
( |
void * |
ptr, |
|
|
size_t |
size |
|
) |
| |
|
virtual |
Reads a block of binary input data.
- Parameters
-
ptr | pointer to the buffer for the data read |
size | number of bytes to be read |
- Returns
- the number of bytes successfully read or 0; can be less than size on EOF/error
Implements SpectMorph::GenericIn.
◆ skip()
bool StdioIn::skip |
( |
size_t |
size | ) |
|
|
virtual |
Skips a block of input data.
- Parameters
-
size | number of bytes to be skipped |
- Returns
- true if the number of bytes was available and could be skipped, false otherwise
Implements SpectMorph::GenericIn.
The documentation for this class was generated from the following files: