Loading...
Searching...
No Matches
Public Member Functions | Static Protected Member Functions | List of all members
BPropertyInfo Class Reference

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_infoProperties () 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.
 

Detailed Description

Class used to manage scripting.

Since
BeOS R3

Constructor & Destructor Documentation

◆ BPropertyInfo()

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.

Parameters
propertyInfoThe NULL-terminated properties array.
valueInfoThe NULL-terminated values array.
freeOnDeleteif true, free the memory associated with propertyInfo and valueInfo when the object is destroyed.
Since
BeOS R4

◆ ~BPropertyInfo()

BPropertyInfo::~BPropertyInfo ( )
virtual

Destructor method.

If freeOnDelete is set to true in the constructor this method frees all memory associated with propertyInfo and valueInfo.

Since
BeOS R3

Member Function Documentation

◆ AllowsTypeCode()

bool BPropertyInfo::AllowsTypeCode ( type_code  code) const
virtual

Returns true if code is B_PROPERTY_INFO_TYPE, false otherwise.

See also
BFlattenable::AllowsTypeCode()
Since
BeOS R4

Reimplemented from BFlattenable.

◆ CountProperties()

int32 BPropertyInfo::CountProperties ( ) const

Returns The number of properties specified as an int32.

Since
BeOS R4

◆ CountValues()

int32 BPropertyInfo::CountValues ( ) const

Returns The number of values specified as an int32.

Since
BeOS R4

◆ FindCommand()

bool BPropertyInfo::FindCommand ( uint32  what,
int32  index,
property_info propertyInfo 
)
staticprotected

Find the command inside of propertyInfo matching what and index.

You may want to override this method in derived classes.

Returns
true if the command was found, false otherwise.
Since
BeOS R4

◆ FindMatch()

int32 BPropertyInfo::FindMatch ( BMessage message,
int32  index,
BMessage specifier,
int32  form,
const char *  property,
void *  data = NULL 
) const
virtual
Since
BeOS R3

◆ FindSpecifier()

bool BPropertyInfo::FindSpecifier ( uint32  form,
property_info propertyInfo 
)
staticprotected

Find the specifier inside of propertyInfo matching form.

You may want to override this method in derived classes.

Returns
true if the specifier was found, false otherwise.
Since
BeOS R4

◆ Flatten()

status_t BPropertyInfo::Flatten ( void *  buffer,
ssize_t  numBytes 
) const
virtual
See also
BFlattenable::Flatten()
Since
BeOS R4

Implements BFlattenable.

◆ FlattenedSize()

ssize_t BPropertyInfo::FlattenedSize ( ) const
virtual

Returns the size of the flattened object in bytes.

See also
BFlattenable::FlattenedSize()
Since
BeOS R4

Implements BFlattenable.

◆ IsFixedSize()

bool BPropertyInfo::IsFixedSize ( ) const
virtual

Always returns false.

See also
BFlattenable::IsFixedSize()
Since
BeOS R4

Implements BFlattenable.

◆ PrintToStream()

void BPropertyInfo::PrintToStream ( ) const

Prints each property, command, type, and specifier to standard output.

Since
BeOS R4

◆ Properties()

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.

Since
BeOS R4

◆ TypeCode()

type_code BPropertyInfo::TypeCode ( ) const
virtual

Always returns B_PROPERTY_INFO_TYPE.

See also
BFlattenable::TypeCode()
Since
BeOS R4

Implements BFlattenable.

◆ Unflatten()

status_t BPropertyInfo::Unflatten ( type_code  code,
const void *  buffer,
ssize_t  numBytes 
)
virtual
See also
BFlattenable::Unflatten()
Since
BeOS R4

Implements BFlattenable.

◆ Values()

const value_info * BPropertyInfo::Values ( ) const

Returns the values as a value_info pointer.

Returns the pointer directly, does not make copy.

Since
BeOS R4