PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFXAnsiStringStreamWriter
Class for a stream to write the AChar string onto.
#include <SFXAnsiStringStreamWriter.h.hpp>
class SFXAnsiStringStreamWriter : public SFXStreamWriter, public SFXStringStream;
SFMTYPEDEFCLASS(SFXAnsiStringStreamWriter)

Inheritance diagram

 Inheritance diagram of SFXAnsiStringStreamWriterClass

Collaboration diagram

 Collaboration diagram of SFXAnsiStringStreamWriterClass

Description

The SFXAnsiStringStreamWriter class is used to write the string of the AChar type onto the string stream of the storage.

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

[Caution] Inserter(<< Operator)

In the string stream, the inserter(<< 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

SFXAnsiStringStreamReader | SFXWideStringStreamWriter | SFXBinaryStreamWriter | SFXElasticStreamWriter | SFXAnsiString | Character Type | String Stream | Storage

Member

Constructor/Destructor
SFXAnsiStringStreamWriter( Void )
Constructor of the SFXAnsiStringStreamWriter class.
Public Functions
SFCError WriteAChar( ACharConstPtr string , SInt32 length = -1 )
Write the specified string onto this stream.
SFCError WriteNull( Void )
Write "\0" onto this stream.
SFCError WriteSFXAnsiString( SFXAnsiStringConstRef param )
Write the specified string onto this stream.
SFCError WriteSFXWideString( SFXWideStringConstRef param )
Write the specified string onto this stream.
SFCError WriteWChar( WCharConstPtr string , SInt32 length = -1 )
Write the specified string onto this stream.
Void ends( SFXAnsiStringStreamWriterRef stream )
Manipulator for writing "\0" onto this stream.
SFXAnsiStringStreamWriterRef operator<<( SFXAnsiStringStreamWriterRef left , SFXAnsiStringStreamWriter::ManipulatorSPP right )
Write the specified string onto this stream.
SFXAnsiStringStreamWriterRef operator<<( SFXAnsiStringStreamWriterRef left , ACharConstPtr right )
Write the specified string onto this stream.
SFXAnsiStringStreamWriterRef operator<<( SFXAnsiStringStreamWriterRef left , WCharConstPtr right )
Write the specified string onto this stream.
SFXAnsiStringStreamWriterRef operator<<( SFXAnsiStringStreamWriterRef left , SFXAnsiStringConstRef right )
Write the specified string onto this stream.
SFXAnsiStringStreamWriterRef operator<<( SFXAnsiStringStreamWriterRef left , SFXWideStringConstRef right )
Write the specified string onto this stream.
Void Attach( SFXOutputStreamPtr stream ) (inherits from SFXStreamWriter)
Attach the specified stream to this stream.
Void Cancel( Void ) (inherits from SFXStreamWriter)
Cancel to write onto this stream.
SFXOutputStreamPtr Detach( Void ) (inherits from SFXStreamWriter)
Detach the stream from this stream.
SFCError Flush( Void ) (inherits from SFXStreamWriter)
Write data in the stream buffer into the storage.
SFCError Flush( CallbackSPP spp , VoidPtr reference ) (inherits from SFXStreamWriter)
Write data in the stream buffer into the storage.
UInt32 GetWritableSize( Void ) (inherits from SFXStreamWriter)
Get the size of data that can be written into this stream. [in bytes]
Void Release( Void ) (inherits from SFXStreamWriter)
Release this stream.
SFCError ResetTrigger( Void ) (inherits from SFXStreamWriter)
Reset the trigger condition that the callback function will be booted up.
SFCError SetTrigger( UInt32 size ) (inherits from SFXStreamWriter)
Set the trigger condition that the callback function will be booted up.
SFCError SetTrigger( SFXBufferConstRef buffer ) (inherits from SFXStreamWriter)
Set the trigger condition that the callback function will be booted up.
SFCError SetTrigger( VoidConstPtr buffer , UInt32 size ) (inherits from SFXStreamWriter)
Set the trigger condition that the callback function will be booted up.
Bool Triggers( Void ) (inherits from SFXStreamWriter)
Check whether or not the callback function is booted up by the trigger condition.
SFCError Write( SFXBufferConstRef buffer ) (inherits from SFXStreamWriter)
Write data onto the stream.
SFCError Write( VoidConstPtr buffer , UInt32 size ) (inherits from SFXStreamWriter)
Write data onto the stream.
Types
ManipulatorSPP
Type that represents the manpulator of the SFXAnsiStringStreamWriter class.
CallbackSPP (inherits from SFXStream)
Type that represents the callback function.

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

SFXAnsiStringStreamWriter::WriteAChar
Write the specified string onto this stream.
[ public ]
SFCError WriteAChar(
    ACharConstPtr string   // string to write
    SInt32 length = -1     // length of the string
);

Argument

string

String of AChar type.

length

string length. If specified with "-1", the length is until the "\0"( "\0" is not included ).

Return value

  • If succeeds: SFERR_NO_ERROR
  • If the stream is not set: SFERR_INVALID_STATE
  • If the specified string contains some of the buffer of this stream: SFERR_INVALID_PARAM
  • If insufficient memory: SFERR_NO_MEMORY
  • If the specified string is bigger than the writable size of the buffer of this buffer: SFERR_FAILED

Description

This function writes the specified AChar string of the specified size onto the buffer of this stream.

If "-1" is specified in the length argument, the string until '\0' specified in the string argument ('\0' is not included) will be passed.

[Note] Note

'\0' will not be appended onto the tail of the string.

The SFXBinaryStreamWriter::WriteAChar function of the binary string will append '\0' onto the tail of the string.

Reference

SFXAnsiStringStreamReader::ReadSFXAnsiString | SFXAnsiStringStreamWriter::WriteSFXAnsiString | SFXAnsiStringStreamWriter::WriteWChar | SFXAnsiStringStreamWriter::WriteSFXWideString | SFXBinaryStreamWriter::WriteAChar | SFXAnsiString | Character Type


SFXAnsiStringStreamWriter::WriteNull
Write "\0" onto this stream.
[ public ]
SFCError WriteNull(Void);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If the stream is not set: SFERR_INVALID_STATE
  • If insufficient memory: SFERR_NO_MEMORY
  • If internal buffer is full of data: SFERR_FAILED

Description

This function writes "\0" (1 byte) of the AChar type onto the buffer of this stream.

This function is same as the SFXAnsiStringStreamWriter::ends function, except it returns the error value.

Reference

SFXAnsiStringStreamWriter::ends | SFXAnsiString | Character Type


SFXAnsiStringStreamWriter::WriteSFXAnsiString
Write the specified string onto this stream.
[ public ]
SFCError WriteSFXAnsiString(
    SFXAnsiStringConstRef param   // string to write
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If the stream is not set: SFERR_INVALID_STATE
  • If the specified string contains some of the buffer of this stream: SFERR_INVALID_PARAM
  • If insufficient memory: SFERR_NO_MEMORY
  • If the specified string is bigger than the writable size of the buffer of this buffer: SFERR_FAILED

Description

This function writes the specified SFXAnsiString string onto the buffer of this stream.

[Note] Note

"\0" will not be appended onto the tail of the string.

The SFXBinaryStreamWriter::WriteSFXAnsiString function of the binary stream will append '\0' onto the tail of the string automatically.

Reference

SFXAnsiStringStreamReader::ReadSFXAnsiString | SFXAnsiStringStreamWriter::WriteAChar | SFXAnsiStringStreamWriter::WriteWChar | SFXAnsiStringStreamWriter::WriteSFXWideString | SFXBinaryStreamWriter::WriteSFXAnsiString | Stream Buffer | SFXAnsiString | Character Type


SFXAnsiStringStreamWriter::WriteSFXWideString
Write the specified string onto this stream.
[ public ]
SFCError WriteSFXWideString(
    SFXWideStringConstRef param   // string to write
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If the stream is not set: SFERR_INVALID_STATE
  • If the specified string contains some of the buffer of this stream: SFERR_INVALID_PARAM
  • If insufficient memory: SFERR_NO_MEMORY
  • If the specified string is bigger than the writable size of the buffer of this buffer: SFERR_FAILED

Description

This function writes the specified SFXWideString string onto the buffer of this stream.

[Note] Note

"\0" will not be appended onto the tail of the string.

The SFXBinaryStreamWriter::WriteSFXWideString function of the binary stream will append '\0' onto the tail of the string automatically.

Reference

SFXAnsiStringStreamReader::ReadSFXWideString | SFXAnsiStringStreamWriter::WriteAChar | SFXAnsiStringStreamWriter::WriteSFXAnsiString | SFXAnsiStringStreamWriter::WriteWChar | SFXBinaryStreamWriter::WriteSFXAnsiString | Stream Buffer | SFXAnsiString | SFXWideString | Character Type


SFXAnsiStringStreamWriter::WriteWChar
Write the specified string onto this stream.
[ public ]
SFCError WriteWChar(
    WCharConstPtr string   // string to write
    SInt32 length = -1     // length of the string
);

Argument

string

String of WChar type.

length

string length. If specified with "-1", the length is until the "\0"( "\0" is not included ).

Return value

  • If succeeds: SFERR_NO_ERROR
  • If the stream is not set: SFERR_INVALID_STATE
  • If the specified string contains some of the buffer of this stream: SFERR_INVALID_PARAM
  • If insufficient memory: SFERR_NO_MEMORY
  • If the specified string is bigger than the writable size of the buffer of this buffer: SFERR_FAILED

Description

This function writes the specified WChar string of the specified size as the AChar string onto the buffer of this stream.

If "-1" is specified in the length argument, the string until '\0' specified in the string argument ('\0' is not included) will be passed.

[Note] Note

'\0' will not be appended onto the tail of the string.

The SFXBinaryStreamWriter::WriteWChar function of the binary string will append '\0' onto the tail of the string.

Reference

SFXAnsiStringStreamWriter::WriteSFXWideString | SFXAnsiStringStreamWriter::WriteAChar | SFXAnsiStringStreamWriter::WriteSFXAnsiString


SFXAnsiStringStreamWriter::ends
Manipulator for writing "\0" onto this stream.
[ public, friend ]
Void ends(
    SFXAnsiStringStreamWriterRef stream   // stream
);

Description

This function is the manipulator for writing "\0" (1 byte) of the AChar type onto the buffer of this stream.

This function is same as the SFXAnsiStringStreamWriter::WriteNull function, except that it returns no error value.

Reference

SFXAnsiStringStreamWriter::WriteNull | Character Type


SFXAnsiStringStreamWriter::operator<<
Write the specified string onto this stream.
[ public, friend ]
SFXAnsiStringStreamWriterRef operator<<(
    SFXAnsiStringStreamWriterRef left                 // stream
    SFXAnsiStringStreamWriter::ManipulatorSPP right   // manipulator
);
[ public, friend ]
SFXAnsiStringStreamWriterRef operator<<(
    SFXAnsiStringStreamWriterRef left   // stream
    ACharConstPtr right                 // string to write
);
[ public, friend ]
SFXAnsiStringStreamWriterRef operator<<(
    SFXAnsiStringStreamWriterRef left   // stream
    WCharConstPtr right                 // string to write
);
[ public, friend ]
SFXAnsiStringStreamWriterRef operator<<(
    SFXAnsiStringStreamWriterRef left   // stream
    SFXAnsiStringConstRef right         // string to write
);
[ public, friend ]
SFXAnsiStringStreamWriterRef operator<<(
    SFXAnsiStringStreamWriterRef left   // stream
    SFXWideStringConstRef right         // string to write
);

Description

This operator is the inserter (<< operator) to write the specified string onto the buffer of this stream.

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

  • If the stream is not set: SFERR_INVALID_STATE error
  • If the specified string contains some of the buffer of this stream: SFERR_INVALID_PARAM error
  • If insufficient memory: SFERR_NO_MEMORY error
  • If the specified string is bigger than the writable size of the buffer of this buffer: SFERR_FAILED error

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

[Note] Alternate Function

Except that the inserter will not return the error value, it is the same as the SFXAnsiStringStreamWriter::WriteAChar / SFXAnsiStringStreamWriter::WriteSFXAnsiString / SFXAnsiStringStreamWriter::WriteWChar / SFXAnsiStringStreamWriter::WriteSFXWideString function.

[Note] Note

"\0" will not be appended onto the tail of the string.

The SFXBinaryStreamWriter::operator< inserter(<< operator) of the binary stream will append '\0' onto the tail of the string automatically.

Reference

SFXAnsiStringStreamReader::operator>> | SFXAnsiStringStreamWriter::WriteAChar | SFXAnsiStringStreamWriter::WriteSFXAnsiString | SFXAnsiStringStreamWriter::WriteWChar | SFXAnsiStringStreamWriter::WriteSFXWideString | SFXAnsiString | SFXWideString | Character Type


SFXAnsiStringStreamWriter::ManipulatorSPP
Type that represents the manpulator of the SFXAnsiStringStreamWriter class.
typedef Void(* SFXAnsiStringStreamWriter::ManipulatorSPP)(SFXAnsiStringStreamWriterRef stream)