|
Typed Data Handling |
These functions read and write typed data in the parcel. This data is formatted the same way as SValue's archived representation, so it is valid to write a single chunk of data through these APIs, which is read back as a generic SValue (or vice-versa).
|
ssize_t | MarshalFixedData (type_code type, const void *data, size_t amount) |
| Write fixed-sized marshalled data to parcel.
|
ssize_t | ReadFlatBinderObject (flat_binder_object *out) |
| Core API for reading a driver binder type.
|
ssize_t | ReadSmallData (small_flat_data *out) |
| Core API for reading the next type header from the parcel.
|
ssize_t | ReadSmallDataOrObject (small_flat_data *out, const void *who) |
| Like ReadSmallData(), but will also read object references.
|
status_t | ReadTypedData (type_code type, void *data) |
| Read data by type code.
|
SValue | ReadValue () |
| Read an SValue.
|
status_t | SkipValue () |
| Skip over a typed value in the parcel, without reading it.
|
status_t | UnmarshalFixedData (type_code type, void *data, size_t amount) |
| Read fixed-sized marshalled data from parcel.
|
ssize_t | WriteBinder (const flat_binder_object &val) |
| Core API for writing a binder type.
|
ssize_t | WriteLargeData (uint32_t packedType, size_t length, const void *data) |
| Core API for writing a large type header and its data.
|
ssize_t | WriteSmallData (const small_flat_data &flat) |
| Core API for writing small flat data structure.
|
ssize_t | WriteSmallData (uint32_t packedType, uint32_t packedData) |
| Core API for writing a small type header and its data.
|
ssize_t | WriteTypedData (type_code type, const void *data) |
| Write data by type code.
|
ssize_t | WriteTypeHeader (type_code type, size_t amount) |
| Write only the header part of a typed data.
|
ssize_t | WriteTypeHeaderAndData (type_code type, const void *data, size_t amount) |
| Write header and data.
|
ssize_t | WriteValue (const SValue &val) |
| Write an SValue.
|
static ssize_t | TypedDataSize (type_code type, const void *data) |
| If you were to use WriteTypedData() to write this data, how much would it write?
|
Reading and Writing Objects |
This is the high-level object API. Objects are written as structured types, so you can you can mix between reading/writing with these functions and with SValue.
|
sptr< IBinder > | ReadBinder () |
sptr< SKeyID > | ReadKeyID () |
wptr< IBinder > | ReadWeakBinder () |
ssize_t | WriteBinder (const small_flat_data &val) |
ssize_t | WriteBinder (const sptr< IBinder > &val) |
ssize_t | WriteKeyID (const sptr< SKeyID > &val) |
ssize_t | WriteWeakBinder (const wptr< IBinder > &val) |
static ssize_t | BinderSize (const sptr< IBinder > &val) |
static ssize_t | WeakBinderSize (const wptr< IBinder > &val) |
Public Types |
typedef void(* | free_func )(const void *data, ssize_t len, void *context) |
typedef status_t(* | reply_func )(const SParcel &buffer, void *context) |
Public Member Functions |
void * | Alloc (ssize_t len) |
| Allocate data in the parcel that you can edit.
|
ssize_t | Avail () const |
| Return the bytes available for use in this parcel, or an error code.
|
ssize_t | AvailBinders () const |
| Return the number of Binders that will still fit in the parcel, or an error code.
|
status_t | Copy (const SParcel &src) |
| Allocate data in the parcel, copying from another parcel.
|
status_t | Copy (const void *data, ssize_t len) |
| Allocate data in the parcel, copying from somewhere else.
|
int32_t | CountValues () const |
| Return the number of values in the parcel.
|
const void * | Data () const |
| Return a pointer to the data in this parcel.
|
void * | EditData () |
| Return an editable pointer to the data in this parcel.
|
status_t | ErrorCheck () const |
| Return the current operating status of the parcel.
|
void | Free () |
| Deallocating data currently in the parcel.
|
int32_t | GetValues (int32_t maxCount, SValue *outValues) const |
| Retrieve flattened values from the parcel.
|
bool | IsCacheable () const |
| Will PutParcel() be able to return this parcel to the cache?
|
ssize_t | Length () const |
| Return the number of bytes in this parcel, or an error code.
|
off_t | Position () const |
void | PrintToStream (const sptr< ITextOutput > &io, uint32_t flags=0) const |
void * | ReAlloc (ssize_t len) |
| Modify data in the parcel.
|
void | Reference (const void *data, ssize_t len, free_func freeFunc=NULL, void *context=NULL) |
| Set the parcel to reference an external block of data.
|
status_t | Reserve (ssize_t len) |
| Create space in the parcel for data.
|
void | Reset () |
| Release all binders and forget the contents, but don't free the data buffer.
|
status_t | SetLength (ssize_t len) |
void | SetPosition (off_t pos) |
status_t | SetValues (const SValue *value1,...) |
| Allocate data in the parcel as an array of flattened values.
|
| SParcel (const void *data, ssize_t len, free_func freeFunc=NULL, void *freeContext=NULL, reply_func replyFunc=NULL, void *replyContext=NULL) |
| SParcel (reply_func replyFunc, void *replyContext=NULL) |
| SParcel (sptr< IByteOutput > output, sptr< IByteInput > input, sptr< IByteSeekable > seek, ssize_t bufferSize=-1) |
| SParcel (ssize_t bufferSize=-1) |
void | Transfer (SParcel *src) |
| Transfer ownership of the data from the given SParcel to this one, leaving.
|
virtual | ~SParcel () |
|
Retrieving and restoring binder information in the parcel.
|
const void * | BinderOffsetsData () const |
size_t | BinderOffsetsLength () const |
status_t | SetBinderOffsets (binder_ipc_info const *const offsets, size_t count, bool takeRefs=true) |
|
These functions do not read/write a type header. Consider them 'low level'.
|
ssize_t | Drain (size_t amount) |
ssize_t | DrainPadding () |
| Skip past padding to next 8-byte boundary.
|
ssize_t | Flush () |
ssize_t | Read (void *buffer, size_t amount) |
bool | ReadBool () |
double | ReadDouble () |
float | ReadFloat () |
const void * | ReadInPlace (size_t amount) |
int16_t | ReadInt16 () |
int32_t | ReadInt32 () |
int64_t | ReadInt64 () |
int8_t | ReadInt8 () |
ssize_t | ReadPadded (void *buffer, size_t amount) |
SString | ReadString () |
uint16_t | ReadUInt16 () |
uint32_t | ReadUInt32 () |
uint64_t | ReadUInt64 () |
uint8_t | ReadUInt8 () |
ssize_t | Sync () |
ssize_t | Write (const void *buffer, size_t amount) |
ssize_t | WriteBool (bool val) |
ssize_t | WriteDouble (double val) |
ssize_t | WriteFloat (float val) |
void * | WriteInPlace (size_t amount) |
| Extend the data stream by amount and return a pointer to the begining of the new chunk.
|
ssize_t | WriteInt16 (int16_t val) |
ssize_t | WriteInt32 (int32_t val) |
ssize_t | WriteInt64 (int64_t val) |
ssize_t | WriteInt8 (int8_t val) |
ssize_t | WritePadded (const void *buffer, size_t amount) |
| Write data, padded appropriated (by 8 bytes).
|
ssize_t | WritePadding () |
| Add padding to ensure next write is at 8-byte boundary.
|
ssize_t | WriteString (const char *val) |
ssize_t | WriteString (const SString &val) |
ssize_t | WriteUInt16 (uint16_t val) |
ssize_t | WriteUInt32 (uint32_t val) |
ssize_t | WriteUInt64 (uint64_t val) |
ssize_t | WriteUInt8 (uint8_t val) |
|
status_t | Reply () |
bool | ReplyRequested () const |
| Sending replies. XXX REMOVE.
|
Static Public Member Functions |
static SParcel * | GetParcel (void) |
static void | PutParcel (SParcel *) |
Protected Member Functions |
virtual ssize_t | ReadBuffer (void *buffer, size_t len) |
virtual ssize_t | WriteBuffer (const void *buffer, size_t len) const |