MDL SDK API nvidia_logo_transpbg.gif Up
mi::neuraylib::IWriter Class Referenceabstract

A writer supports binary block writes and string-oriented line writes that accept a zero-terminated string as argument. More...

#include <iwriter.h>

Inheritance diagram for mi::neuraylib::IWriter:

Public Member Functions

virtual Sint64 write (const char *buffer, Sint64 size)=0
 Writes a number of bytes to the stream. More...
 
virtual bool writeline (const char *str)=0
 Writes a zero-terminated string to the stream. More...
 
virtual bool flush ()=0
 Flushes all buffered output to the stream. More...
 
- Public Member Functions inherited from mi::neuraylib::IReader_writer_base
virtual Sint32 get_error_number () const =0
 Returns the error number of the last error that happened in this reader or writer, or 0 if no error occurred. More...
 
virtual const char * get_error_message () const =0
 Returns the error message of the last error that happened in this reader or writer. More...
 
virtual bool eof () const =0
 Returns true if the end of the file has been reached. More...
 
virtual Sint32 get_file_descriptor () const =0
 Returns the file descriptor of the stream, or -1 if it is not available. More...
 
virtual bool supports_recorded_access () const =0
 Returns true if random recorded access is supported, and false otherwise. More...
 
virtual const IStream_positiontell_position () const =0
 Returns the current position in this stream. More...
 
virtual bool seek_position (const IStream_position *stream_position)=0
 Repositions the stream to the position stream_position. More...
 
virtual bool rewind ()=0
 Resets the stream position to the beginning. More...
 
virtual bool supports_absolute_access () const =0
 Returns true if random absolute access is supported, and false otherwise. More...
 
virtual Sint64 tell_absolute () const =0
 Returns the absolute position in bytes from the beginning of the stream beginning, or -1 if absolute access is not supported. More...
 
virtual bool seek_absolute (Sint64 pos)=0
 Repositions the stream to the absolute position pos. More...
 
virtual Sint64 get_file_size () const =0
 Returns the size in bytes of the data in the stream. More...
 
virtual bool seek_end ()=0
 Sets the stream position to the end of the file. More...
 
- Public Member Functions inherited from mi::base::IInterface
virtual Uint32 retain () const =0
 Increments the reference count. More...
 
virtual Uint32 release () const =0
 Decrements the reference count. More...
 
virtual const IInterfaceget_interface (const Uuid &interface_id) const =0
 Acquires a const interface from another. More...
 
template<class T>
const T * get_interface () const
 Acquires a const interface from another. More...
 
virtual IInterfaceget_interface (const Uuid &interface_id)=0
 Acquires a mutable interface from another. More...
 
template<class T>
T * get_interface ()
 Acquires a mutable interface from another. More...
 
virtual Uuid get_iid () const =0
 Returns the interface ID of the most derived interface. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0x0e6ecfbc, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::Interface_declare< 0x919370c2, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::IInterface
typedef Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> IID
 Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x0e6ecfbc, ... >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x919370c2, ... >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 
- Static Public Member Functions inherited from mi::base::IInterface
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface. More...
 

Detailed Description

A writer supports binary block writes and string-oriented line writes that accept a zero-terminated string as argument.

Member Function Documentation

 flush()

virtual bool mi::neuraylib::IWriter::flush ( )
pure virtual

Flushes all buffered output to the stream.

Returns
true in case of success, or false in case of errors.

 write()

virtual Sint64 mi::neuraylib::IWriter::write ( const char *  buffer,
Sint64  size 
)
pure virtual

Writes a number of bytes to the stream.

Parameters
bufferThe buffer from where to read the data.
sizeThe number of bytes to write.
Returns
The number of bytes written, or -1 in case of errors.

 writeline()

virtual bool mi::neuraylib::IWriter::writeline ( const char *  str)
pure virtual

Writes a zero-terminated string to the stream.

Parameters
strThe string to be written. Note that the writer does not add an extra newline character at the end.
Returns
true in case of success, or false in case of errors.