Class used to manage scripting. More...
Inherits BFlattenable.
Public Member Functions | |
BPropertyInfo (property_info *prop=NULL, value_info *value=NULL, bool freeOnDelete=false) | |
Initializes the object with the specified NULL-terminated arrays propertyInfo and valueInfo. | |
virtual | ~BPropertyInfo () |
Destructor method. | |
virtual bool | AllowsTypeCode (type_code code) const |
Returns true if code is B_PROPERTY_INFO_TYPE, false otherwise. | |
int32 | CountProperties () const |
Returns The number of properties specified as an int32. | |
int32 | CountValues () const |
Returns The number of values specified as an int32. | |
virtual int32 | FindMatch (BMessage *msg, int32 index, BMessage *specifier, int32 form, const char *prop, void *data=NULL) const |
virtual status_t | Flatten (void *buffer, ssize_t size) const |
virtual ssize_t | FlattenedSize () const |
Returns the size of the flattened object in bytes. | |
virtual bool | IsFixedSize () const |
Always returns false . | |
void | PrintToStream () const |
Prints each property, command, type, and specifier to standard output. | |
const property_info * | Properties () const |
Returns the properties as a property_info pointer. | |
virtual type_code | TypeCode () const |
Always returns B_PROPERTY_INFO_TYPE . | |
virtual status_t | Unflatten (type_code code, const void *buffer, ssize_t size) |
const value_info * | Values () const |
Returns the values as a value_info pointer. | |
Public Member Functions inherited from BFlattenable | |
virtual | ~BFlattenable () |
Destructor. Does nothing. | |
virtual bool | AllowsTypeCode (type_code code) const |
Get whether or not the supplied type_code is supported. | |
virtual status_t | Flatten (void *buffer, ssize_t size) const =0 |
Pure virtual that should flatten the object into the supplied buffer. | |
virtual ssize_t | FlattenedSize () const =0 |
Pure virtual that should return the size of the flattened object in bytes. | |
virtual bool | IsFixedSize () const =0 |
Pure virtual that should return whether or not flattened objects of this type always have a fixed size. | |
virtual type_code | TypeCode () const =0 |
Pure virtual that returns the type_code this class flattens to. | |
virtual status_t | Unflatten (type_code code, const void *buffer, ssize_t size)=0 |
Pure virtual that should unflatten the buffer and put the contents into the current object. | |
Static Protected Member Functions | |
static bool | FindCommand (uint32 what, int32 index, property_info *info) |
Find the command inside of propertyInfo matching what and index. | |
static bool | FindSpecifier (uint32 form, property_info *info) |
Find the specifier inside of propertyInfo matching form. | |
Class used to manage scripting.
BPropertyInfo::BPropertyInfo | ( | property_info * | propertyInfo = NULL , |
value_info * | valueInfo = NULL , |
||
bool | freeOnDelete = false |
||
) |
Initializes the object with the specified NULL-terminated arrays propertyInfo and valueInfo.
The arrays are not copied so do not modify or delete the arrays while they are in use by BPropertyInfo.
propertyInfo | The NULL-terminated properties array. |
valueInfo | The NULL-terminated values array. |
freeOnDelete | if true , free the memory associated with propertyInfo and valueInfo when the object is destroyed. |
|
virtual |
Destructor method.
If freeOnDelete is set to true
in the constructor this method frees all memory associated with propertyInfo and valueInfo.
|
virtual |
Returns true
if code is B_PROPERTY_INFO_TYPE, false
otherwise.
Reimplemented from BFlattenable.
int32 BPropertyInfo::CountProperties | ( | ) | const |
Returns The number of properties specified as an int32.
int32 BPropertyInfo::CountValues | ( | ) | const |
Returns The number of values specified as an int32.
|
staticprotected |
Find the command inside of propertyInfo matching what and index.
You may want to override this method in derived classes.
true
if the command was found, false
otherwise.
|
virtual |
|
staticprotected |
Find the specifier inside of propertyInfo matching form.
You may want to override this method in derived classes.
true
if the specifier was found, false
otherwise.
|
virtual |
|
virtual |
Returns the size of the flattened object in bytes.
Implements BFlattenable.
|
virtual |
void BPropertyInfo::PrintToStream | ( | ) | const |
Prints each property, command, type, and specifier to standard output.
const property_info * BPropertyInfo::Properties | ( | ) | const |
Returns the properties as a property_info
pointer.
Returns the pointer directly, does not make copy.
Called PropertyInfo() in the BeBook.
|
virtual |
Always returns B_PROPERTY_INFO_TYPE
.
Implements BFlattenable.
const value_info * BPropertyInfo::Values | ( | ) | const |
Returns the values as a value_info
pointer.
Returns the pointer directly, does not make copy.