oeisstream

class oeisstream : public oeistream

This class represents oeisstream.

Implements an input stream that uses a string of data already in memory as the input source.

The following methods are publicly inherited from oeistream:

operator>>

gettoken

skipbyte

close

open

skipline

get

peekbyte

getbyte

read

getline

skip

The following methods are publicly inherited from oestream:

operator bool

rewind

tell

eof

seek

length

size

Constructors

oeisstream(buffer: str, len: oesize_t, copy: bool = True) -> oeisstream
oeisstream(buffer: str) -> oeisstream
oeisstream() -> oeisstream
oeisstream(rhs: oeisstream) -> oeisstream

Creates a new oeisstream. Passing any of the specified parameters to the one of the non-default constructors is equivalent to creating a new oeisstream with the default constructor and then calling the appropriate oeisstream.set method on that stream.

If the copy constructor is used, the newly created oeisstream will read from the same data string as the stream being copied from. If the ‘copy’ parameter was set to true on the stream being copied from, the new stream will create its own local copy to read from, otherwise it will just point to the same place in memory as the original stream. In addition, the newly constructed stream’s reading pointer will be set to the same location as the one in the stream being copied from.

Regardless of whether or not a local copy is made, the stream takes no responsibility for the management of the original input source’s memory.

clear

clear() -> None

Clears the association with input source associated with this stream. If the copy parameter was set to false when this stream was assigned or constructed, no changes will be made to the original data source.

getbuffer

getbuffer(buffer: str) -> bool

Copies the entire contents of the input source into the specified string regardless of the current location of the reading pointer and returns whether or not this was successful.

reset

reset() -> bool

Resets the reading pointer to the beginning of the input stream and returns whether or not this was successful. This is equivalent to calling the oestream.rewind method of oestream.

set

set(arg2: str) -> bool
set(arg2: str, arg3: oesize_t, arg4: bool) -> bool

Sets the input source of this stream based on the specified parameters. The buffer parameter specifies the data string to be used as the input source. If the char * constructors are used, the length of the input buffer must be specified as well as whether or not a local copy of the buffer should be made and used as the input source. If the std::string method is used, a local copy of the input string will be made and used as the input source.

Regardless of whether or not a local copy is made, the stream takes no responsibility for the management of the original input source’s memory.