#include <support/Datum.h>
This class makes it easier to work with the dual nature of IDatum (SValue vs. Open()) by providing new APIs for retrieving the datum value that are more robust for the client.
Bookkeeping | |
Creation, destruction, copying, comparing, etc. | |
sptr< IDatum > | Datum () const |
Retrieve the IDatum object being used. | |
bool | operator!= (const SDatum &o) const |
Retrieve the IDatum object being used. | |
bool | operator< (const SDatum &o) const |
Retrieve the IDatum object being used. | |
bool | operator<= (const SDatum &o) const |
Retrieve the IDatum object being used. | |
SDatum & | operator= (const SDatum &o) |
Replace this SDatum with o. | |
bool | operator== (const SDatum &o) const |
Retrieve the IDatum object being used. | |
bool | operator> (const SDatum &o) const |
Retrieve the IDatum object being used. | |
bool | operator>= (const SDatum &o) const |
Retrieve the IDatum object being used. | |
SDatum (const SDatum &datum) | |
Copy from another SDatum. | |
SDatum (const sptr< IDatum > &datum) | |
Initialize directly from an IDatum. | |
SDatum (const sptr< IBinder > &binder) | |
Retrieve a datum from an IBinder, casting to an IDatum interface. | |
SDatum (const SValue &value) | |
Retrieve a datum from a generic SValue. | |
SDatum () | |
Create a new, empty datum. | |
status_t | StatusCheck () const |
Returns B_OK if we hold a value IDatum or defined SValue. | |
~SDatum () | |
Release reference on IDatum. | |
Datum Operations | |
Convenience functions for working with IDatum. | |
SValue | FetchTruncatedValue (size_t maxSize, status_t *outError=NULL) const |
Retrieve data, possibly truncated, associated with this value. | |
SValue | FetchValue (size_t maxSize, status_t *outError=NULL) const |
Retrieve the entire data associated with this value. | |
sptr< IByteInput > | OpenInput (uint32_t mode=IDatum::READ_ONLY, status_t *outError=NULL) const |
Open datum for reading. | |
sptr< IByteOutput > | OpenOutput (uint32_t mode, const sptr< IBinder > &editor, uint32_t newType, status_t *outError=NULL) |
Open datum for writing, allowing editor objects and/or type changes. | |
sptr< IByteOutput > | OpenOutput (uint32_t mode=IDatum::READ_WRITE|IDatum::ERASE_DATUM, status_t *outError=NULL) |
Open datum for simple writing. |
|
Create a new, empty datum.
|
|
Retrieve a datum from a generic SValue. If the SValue contains an IDatum object, that will be used directly. Otherwise, the SValue will be used as a plain blob of data, as if it has been retrieved from IDatum::Value(). |
|
Retrieve a datum from an IBinder, casting to an IDatum interface.
|
|
Initialize directly from an IDatum.
|
|
Copy from another SDatum.
|
|
Release reference on IDatum.
|
|
Retrieve the IDatum object being used.
|
|
Retrieve data, possibly truncated, associated with this value.
|
|
Retrieve the entire data associated with this value.
If, in case of reading the data, IDatum::Size() is larger than maxSize, B_UNDEFINED_VALUE is returned and outError is set to B_OUT_OF_RANGE. Otherwise the data is read in. The function may return an undefined value if some other error occurs while reading, such as running out of memory, in which case outError is set to the appropriate error code. |
|
Open datum for reading.
|
|
Open datum for writing, allowing editor objects and/or type changes.
|
|
Open datum for simple writing.
|
|
Retrieve the IDatum object being used.
|
|
Retrieve the IDatum object being used.
|
|
Retrieve the IDatum object being used.
|
|
Replace this SDatum with o.
|
|
Retrieve the IDatum object being used.
|
|
Retrieve the IDatum object being used.
|
|
Retrieve the IDatum object being used.
|
|
Returns B_OK if we hold a value IDatum or defined SValue.
|