#include <it_bus/file_output_stream.h>
Inheritance diagram for IT_Bus::FileOutputStream:
Definition at line 19 of file file_output_stream.h.
Public Member Functions | |
FileOutputStream (const String &file_name) IT_THROW_DECL((IOException)) | |
Constructor. | |
~FileOutputStream () | |
Destructor. | |
virtual void | write (const Character to_write) IT_THROW_DECL((IOException)) |
Write the character. | |
virtual void | write (const Character *to_write) IT_THROW_DECL((IOException)) |
Write the character. | |
virtual void | write (const Character *to_write, size_t length) IT_THROW_DECL((IOException)) |
Write the character. | |
void | close () |
Close the stream after writing. | |
Private Attributes | |
FILE * | m_fp |
IT_Bus::FileOutputStream::FileOutputStream | ( | const String & | file_name | ) |
void IT_Bus::FileOutputStream::close | ( | ) |
Close the stream after writing.
Although an instance of the FileOutputStream may be encapsulated within a specialized stream class, the close() method is called on the FileOutputStream class. For example, in writing the in-memory WSDL model to a file:
// The WSDL model may be obtained from the Service IT_WSDL::WSDLDefinitions &definitions = service.get_definitions();
// Now initialize an XMLOutputStream and invoke the write() // method on the WSDLDefinitions object. IT_Bus::FileOutputStream stream("<path to, and name of, the output file>"); IT_Bus::XMLOutputStream xml_stream(stream, true); definitions.write(xml_stream); stream.close();
virtual void IT_Bus::FileOutputStream::write | ( | const Character * | to_write, | |
size_t | length | |||
) | [virtual] |
Write the character.
A | pointer to the Character. | |
Number | of characters to write. |
Implements IT_Bus::OutputStream.
virtual void IT_Bus::FileOutputStream::write | ( | const Character * | to_write | ) | [virtual] |
virtual void IT_Bus::FileOutputStream::write | ( | const Character | to_write | ) | [virtual] |
Write the character.
Character | to write to this stream. |
Implements IT_Bus::OutputStream.