neuray Services API Programmer's Manual

mi::nservices::IBinary Class Reference

[Types]

Description

This interface represents binary data. This is used to return opaque, command specific data. The neuray services framework has no knowledge of what the data represents and will not attempt to manipulate it. It is up to the implementing application to know how to deal with this data. Binary data may have an associated mime-type to assist with this.

Public Member Functions

virtual const Uint8get_data() const =0
Get a pointer to the raw data. More...
virtual Size get_data_size() const =0
Get the size of the raw data. More...
virtual const char* get_mime_type() const =0
Get the mime type of the data. More...
virtual Sint32 set_data( const Uint8* data, Size data_size, const char* mime_type = NULL) =0
Set raw data. More...
virtual Sint32 set_data( neuraylib::IBuffer* buffer, const char* mime_type = NULL) =0
Set raw data from a buffer. More...

Member Functions

virtual const Uint8* mi::​nservices::​IBinary::get_data() const [pure virtual]

Get a pointer to the raw data.

Returns

the data pointer or NULL if no data set.

virtual Size mi::​nservices::​IBinary::get_data_size() const [pure virtual]

Get the size of the raw data.

Returns

the data size or 0 if no data set.

virtual const char* mi::​nservices::​IBinary::get_mime_type() const [pure virtual]

Get the mime type of the data.

Returns

the mime type or NULL if no mime type set.

virtual Sint32 mi::​nservices::​IBinary::set_data( const Uint8* data, Size data_size, const char* mime_type = NULL) [pure virtual]

Set raw data.

Parameters

data
the data to set. This data will be copied internally.
data_size
the size of data
mime_type
optional mime type of the data

Returns

  • NRS_ERROR_NONE : success.
  • NRS_ERROR_MEMORY : failed to allocate memory to store data

virtual Sint32 mi::​nservices::​IBinary::set_data( neuraylib::IBuffer* buffer, const char* mime_type = NULL) [pure virtual]

Set raw data from a buffer.

Parameters

buffer
the buffer to source from
mime_type
optional mime type of the data

Returns

  • NRS_ERROR_NONE : success.
  • NRS_ERROR_MEMORY : failed to allocate memory