PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFXAnsiStringStreamReader
Class for a stream to read the AChar string from.
#include <SFXAnsiStringStreamReader.h.hpp>
class SFXAnsiStringStreamReader : public SFXStreamReader, public SFXStringStream;
SFMTYPEDEFCLASS(SFXAnsiStringStreamReader)

Inheritance diagram

 Inheritance diagram of SFXAnsiStringStreamReaderClass

Collaboration diagram

 Collaboration diagram of SFXAnsiStringStreamReaderClass

Description

The SFXAnsiStringStreamReader class is used to read the string of the AChar type from the string stream of the storage.

In case of the variable buffer stream, the SFXElasticStreamReader class is internally used. But you don't have to be aware of this class.

[Caution] Extractor(>> Operator)

In the string stream, the extractor(>> operator) whose right operand is of the SFXBuffer type is not defined. Therefore, the SFXBuffer instance cannot be specified as the right operand.

However, since it is defined in the binary stream, the SFXBuffer instance can be specified as the right operand.

Reference

SFXAnsiStringStreamWriter | SFXWideStringStreamReader | SFXBinaryStreamReader | SFXElasticStreamReader | SFXAnsiString | Character Type | String Stream | Storage

Member

Constructor/Destructor
SFXAnsiStringStreamReader( Void )
Constructor of the SFXAnsiStringStreamReader class.
Public Functions
SFCError ReadSFXAnsiString( SFXAnsiStringPtr param )
Read the AChar string from this stream.
SFCError ReadSFXWideString( SFXWideStringPtr param )
Read the AChar string from this stream.
SFXAnsiStringStreamReaderRef operator>>( SFXAnsiStringStreamReaderRef left , SFXAnsiStringRef right )
Read the AChar string from this stream.
SFXAnsiStringStreamReaderRef operator>>( SFXAnsiStringStreamReaderRef left , SFXWideStringRef right )
Read the AChar string from this stream.
Void Attach( SFXInputStreamPtr stream ) (inherits from SFXStreamReader)
Attach the specified stream to this stream.
Void Cancel( Void ) (inherits from SFXStreamReader)
Cancel to read from this stream.
SFXInputStreamPtr Detach( Void ) (inherits from SFXStreamReader)
Detach the stream from this stream.
Bool Ends( Void ) (inherits from SFXStreamReader)
Check whether or not the read pointer reaches the end of this stream.
SFCError Fetch( Void ) (inherits from SFXStreamReader)
Read data from the storage into this stream.
SFCError Fetch( CallbackSPP spp , VoidPtr reference ) (inherits from SFXStreamReader)
Read data from the storage into this stream.
SInt32 FirstIndexOf( Byte byte , SInt32 index = SINT32_MINIMUM ) (inherits from SFXStreamReader)
Get the first index to match the specified data, searching from the head of the stream buffer.
SInt32 FirstIndexOf( SFXBufferConstRef buffer , SInt32 index = SINT32_MINIMUM ) (inherits from SFXStreamReader)
Get the first index to match the specified data, searching from the head of the stream buffer.
SInt32 FirstIndexOf( VoidConstPtr buffer , UInt32 size , SInt32 index = SINT32_MINIMUM ) (inherits from SFXStreamReader)
Get the first index to match the specified data, searching from the head of the stream buffer.
UInt32 GetReadableSize( Void ) (inherits from SFXStreamReader)
Get the size of data that can be read from this stream. [in bytes]
SInt32 LastIndexOf( Byte byte , SInt32 index = SINT32_MAXIMUM ) (inherits from SFXStreamReader)
Get the last index to match the specified data, searching from the tail of the stream buffer.
SInt32 LastIndexOf( SFXBufferConstRef buffer , SInt32 index = SINT32_MAXIMUM ) (inherits from SFXStreamReader)
Get the last index to match the specified data, searching from the tail of the stream buffer.
SInt32 LastIndexOf( VoidConstPtr buffer , UInt32 size , SInt32 index = SINT32_MAXIMUM ) (inherits from SFXStreamReader)
Get the last index to match the specified data, searching from the tail of the stream buffer.
SFCError Read( SFXBufferPtr buffer ) (inherits from SFXStreamReader)
Read data from the stream.
SFCError Read( VoidPtr buffer , UInt32 size ) (inherits from SFXStreamReader)
Read data from the stream.
Void Release( Void ) (inherits from SFXStreamReader)
Release this stream.
SFCError ResetTrigger( Void ) (inherits from SFXStreamReader)
Reset the trigger condition that the callback function will be booted up.
SFCError Seek( UInt32 size ) (inherits from SFXStreamReader)
Move the read pointer forward.
SFCError SetTrigger( UInt32 size ) (inherits from SFXStreamReader)
Set the trigger condition that the callback function will be booted up.
SFCError SetTrigger( SFXBufferConstRef buffer ) (inherits from SFXStreamReader)
Set the trigger condition that the callback function will be booted up.
SFCError SetTrigger( VoidConstPtr buffer , UInt32 size ) (inherits from SFXStreamReader)
Set the trigger condition that the callback function will be booted up.
Bool Triggers( Void ) (inherits from SFXStreamReader)
Check whether or not the callback function is booted up by the trigger condition.
Types
CallbackSPP (inherits from SFXStream)
Type that represents the callback function.

SFXAnsiStringStreamReader::SFXAnsiStringStreamReader
Constructor of the SFXAnsiStringStreamReader class.
[ public, explicit ]
SFXAnsiStringStreamReader(Void);

SFXAnsiStringStreamReader::ReadSFXAnsiString
Read the AChar string from this stream.
[ public ]
SFCError ReadSFXAnsiString(
    SFXAnsiStringPtr param   // pointer to the variable to be read
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If the stream is not set: SFERR_INVALID_STATE
  • If the param argument is null: SFERR_INVALID_PARAM
  • If insufficient memory: SFERR_NO_MEMORY

Description

This function reads the string of the AChar type from the buffer of this stream and stores it into the variable of the SFXAnsiString type specified in the argument.

Data until the next '\0' (1 byte) of the AChar type or the tail will be read as a string. At this time, '\0' will not be included in the read SFXAnsiString string.

[Note] Note

In case of the SFXBinaryStreamReader::ReadSFXAnsiString function of the binary stream, SFERR_INVALID_STATE will be returned if '\0' is not found until the tail in reading.

Reference

SFXAnsiStringStreamWriter::WriteSFXAnsiString | SFXAnsiStringStreamWriter::WriteAChar | SFXAnsiStringStreamReader::ReadSFXWideString | SFXAnsiStringStreamReader::operator>> | SFXBinaryStreamReader::ReadSFXAnsiString | SFXAnsiString | Character Type


SFXAnsiStringStreamReader::ReadSFXWideString
Read the AChar string from this stream.
[ public ]
SFCError ReadSFXWideString(
    SFXWideStringPtr param   // pointer to the variable to be read
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If the stream is not set: SFERR_INVALID_STATE
  • If the param argument is null: SFERR_INVALID_PARAM
  • If insufficient memory: SFERR_NO_MEMORY

Description

This function reads the string of the AChar type from the buffer of this stream and stores it into the variable of the SFXWideString type specified in the argument.

Data until the next '\0' (1 byte) of the AChar type or the tail will be read as a string. At this time, '\0' will not be included in the read SFXWideString string.

[Note] Note

In case of the SFXBinaryStreamReader::ReadSFXWideString function of the binary stream, SFERR_INVALID_STATE will be returned if '\0' is not found until the tail in reading.

Reference

SFXAnsiStringStreamWriter::WriteSFXWideString | SFXAnsiStringStreamWriter::WriteWChar | SFXAnsiStringStreamReader::ReadSFXAnsiString | SFXAnsiStringStreamReader::operator>> | SFXBinaryStreamReader::ReadSFXWideString | SFXAnsiString | SFXWideString | Character Type


SFXAnsiStringStreamReader::operator>>
Read the AChar string from this stream.
[ public, friend ]
SFXAnsiStringStreamReaderRef operator>>(
    SFXAnsiStringStreamReaderRef left   // stream
    SFXAnsiStringRef right              // variable to be read
);
[ public, friend ]
SFXAnsiStringStreamReaderRef operator>>(
    SFXAnsiStringStreamReaderRef left   // stream
    SFXWideStringRef right              // variable to be read
);

Description

This operator is the extractor (>> operator) to read the string of the AChar type from the buffer of this stream.

Data until the next '\0' (1 byte) of the AChar type or the tail will be read as a string and stored into the variable of the string class specified in the operand. If necessary, type conversion will be performed automatically. At this time, '\0' will not be included in the read string.

In case one of the following errors occurs, no data will be read from this stream, no error value will be returned, and nothing will happen.

  • If the stream is not set: SFERR_INVALID_STATE error
  • If the param argument is null: SFERR_INVALID_PARAM error
  • If insufficient memory: SFERR_NO_MEMORY error

* The corresponding alternate function below will return the error value above.

[Note] Alternate Function

Except that the extractor will not return the error value, it is the same as the SFXAnsiStringStreamReader::ReadSFXAnsiString / SFXAnsiStringStreamReader::ReadSFXWideString function.

Reference

SFXAnsiStringStreamWriter::operator<< | SFXAnsiStringStreamReader::ReadSFXAnsiString | SFXAnsiStringStreamReader::ReadSFXWideString SFXWideString | SFXAnsiString | Character Type