MistServer  2.5.3-Pro-19-gf5e75b1 ( Generic_64)
Public Member Functions | Protected Attributes
AMF::Object3 Class Reference

Recursive class that holds AMF3 objects. More...

#include <amf.h>

Public Member Functions

 Object3 ()
 Default constructor. More...
 
 Object3 ()
 
 Object3 (std::string indice, int val, obj3type setType=AMF3_INTEGER)
 
 Object3 (std::string indice, int val, obj3type setType=AMF3_INTEGER)
 Constructor for integer objects. More...
 
 Object3 (std::string indice, double val, obj3type setType=AMF3_DOUBLE)
 
 Object3 (std::string indice, double val, obj3type setType=AMF3_DOUBLE)
 Constructor for double objects. More...
 
 Object3 (std::string indice, std::string val, obj3type setType=AMF3_STRING)
 Constructor for string objects. More...
 
 Object3 (std::string indice, std::string val, obj3type setType=AMF3_STRING)
 
 Object3 (std::string indice, obj3type setType=AMF3_OBJECT)
 Constructor for container objects. More...
 
 Object3 (std::string indice, obj3type setType=AMF3_OBJECT)
 
void addContent (AMF::Object3 c)
 
void addContent (AMF::Object3 c)
 Adds an AMF::Object to this object. Works for all types, but only makes sense for container types. More...
 
double DblValue ()
 Returns the double value of this object, if available. More...
 
double DblValue ()
 
Object3 getContent (int i)
 Returns a copy of the object held at indice i. More...
 
Object3 getContent (int i)
 
Object3 getContent (std::string s)
 Returns a copy of the object held at indice s. More...
 
Object3 getContent (std::string s)
 
Object3getContentP (int i)
 Returns a pointer to the object held at indice i. More...
 
Object3getContentP (int i)
 
Object3getContentP (std::string s)
 
Object3getContentP (std::string s)
 Returns a pointer to the object held at indice s. More...
 
obj3type GetType ()
 
obj3type GetType ()
 Returns the AMF::obj0type AMF0 object type for this object. More...
 
int hasContent ()
 
int hasContent ()
 Returns a count of the amount of objects this object currently holds. More...
 
std::string Indice ()
 
std::string Indice ()
 Returns the std::string Indice for the current object, if available. More...
 
int IntValue ()
 Returns the integer value of this object, if available. More...
 
int IntValue ()
 
std::string Pack ()
 
std::string Pack ()
 Packs the AMF object to a std::string for transfer over the network. More...
 
std::string Print (std::string indent="")
 
std::string Print (std::string indent="")
 Return the contents as a human-readable string. More...
 
const char * Str ()
 
const char * Str ()
 Returns the C-string value of this object, if available. More...
 
std::string StrValue ()
 
std::string StrValue ()
 Returns the std::string value of this object, if available. More...
 

Protected Attributes

std::vector< Object3contents
 Holds this objects contents, if any (for container types). More...
 
double dblval
 Holds this objects double value, if any. More...
 
int intval
 Holds this objects int value, if any. More...
 
std::string myIndice
 Holds this objects indice, if any. More...
 
obj3type myType
 Holds this objects AMF0 type. More...
 
std::string strval
 Holds this objects string value, if any. More...
 

Detailed Description

Recursive class that holds AMF3 objects.

It supports all AMF3 types (defined in AMF::obj3type), adding support for a special DDVTECH container type.

Constructor & Destructor Documentation

AMF::Object3::Object3 ( )

Default constructor.

Simply fills the data with AMF::Object3("error", AMF3_DDV_CONTAINER)

AMF::Object3::Object3 ( std::string  indice,
int  val,
AMF::obj3type  setType = AMF3_INTEGER 
)

Constructor for integer objects.

The object type is by default AMF::AMF3_INTEGER, but this can be forced to a different value.

Parameters
indiceThe string indice of this object in its container, or empty string if none. Numeric indices are automatic.
valThe numeric value of this object. Integer AMF3 objects only support integer-type values.
setTypeThe object type to force this object to.
AMF::Object3::Object3 ( std::string  indice,
double  val,
AMF::obj3type  setType = AMF3_DOUBLE 
)

Constructor for double objects.

The object type is by default AMF::AMF3_DOUBLE, but this can be forced to a different value.

Parameters
indiceThe string indice of this object in its container, or empty string if none. Numeric indices are automatic.
valThe numeric value of this object. Double AMF3 objects only support double-type values.
setTypeThe object type to force this object to.
AMF::Object3::Object3 ( std::string  indice,
std::string  val,
AMF::obj3type  setType = AMF3_STRING 
)

Constructor for string objects.

The object type is by default AMF::AMF0_STRING, but this can be forced to a different value. There is no need to manually change the type to AMF::AMF0_LONGSTRING, this will be done automatically.

Parameters
indiceThe string indice of this object in its container, or empty string if none. Numeric indices are automatic.
valThe string value of this object.
setTypeThe object type to force this object to.
AMF::Object3::Object3 ( std::string  indice,
AMF::obj3type  setType = AMF3_OBJECT 
)

Constructor for container objects.

The object type is by default AMF::AMF0_OBJECT, but this can be forced to a different value.

Parameters
indiceThe string indice of this object in its container, or empty string if none. Numeric indices are automatic.
setTypeThe object type to force this object to.
AMF::Object3::Object3 ( )
AMF::Object3::Object3 ( std::string  indice,
int  val,
obj3type  setType = AMF3_INTEGER 
)
AMF::Object3::Object3 ( std::string  indice,
double  val,
obj3type  setType = AMF3_DOUBLE 
)
AMF::Object3::Object3 ( std::string  indice,
std::string  val,
obj3type  setType = AMF3_STRING 
)
AMF::Object3::Object3 ( std::string  indice,
obj3type  setType = AMF3_OBJECT 
)

Member Function Documentation

void AMF::Object3::addContent ( AMF::Object3  c)

Adds an AMF::Object to this object. Works for all types, but only makes sense for container types.

void AMF::Object3::addContent ( AMF::Object3  c)
double AMF::Object3::DblValue ( )
double AMF::Object3::DblValue ( )

Returns the double value of this object, if available.

If this object holds no double value, 0 is returned.

AMF::Object3 AMF::Object3::getContent ( int  i)

Returns a copy of the object held at indice i.

Returns a AMF::AMF3_DDV_CONTAINER of indice "error" if no object is held at this indice.

Parameters
iThe indice of the object in this container.
Object3 AMF::Object3::getContent ( int  i)
AMF::Object3 AMF::Object3::getContent ( std::string  s)

Returns a copy of the object held at indice s.

Returns a AMF::AMF0_DDV_CONTAINER of indice "error" if no object is held at this indice.

Parameters
sThe indice of the object in this container.
Object3 AMF::Object3::getContent ( std::string  s)
AMF::Object3 * AMF::Object3::getContentP ( int  i)

Returns a pointer to the object held at indice i.

Returns AMF::AMF3_DDV_CONTAINER of indice "error" if no object is held at this indice.

Parameters
iThe indice of the object in this container.
Object3* AMF::Object3::getContentP ( int  i)
AMF::Object3 * AMF::Object3::getContentP ( std::string  s)

Returns a pointer to the object held at indice s.

Returns NULL if no object is held at this indice.

Parameters
sThe indice of the object in this container.
Object3* AMF::Object3::getContentP ( std::string  s)
AMF::obj3type AMF::Object3::GetType ( )

Returns the AMF::obj0type AMF0 object type for this object.

obj3type AMF::Object3::GetType ( )
int AMF::Object3::hasContent ( )
int AMF::Object3::hasContent ( )

Returns a count of the amount of objects this object currently holds.

If this object is not a container type, this function will always return 0.

std::string AMF::Object3::Indice ( )

Returns the std::string Indice for the current object, if available.

Returns an empty string if no indice exists.

std::string AMF::Object3::Indice ( )
int AMF::Object3::IntValue ( )
int AMF::Object3::IntValue ( )

Returns the integer value of this object, if available.

If this object holds no integer value, 0 is returned.

std::string AMF::Object3::Pack ( )
std::string AMF::Object3::Pack ( )

Packs the AMF object to a std::string for transfer over the network.

If the object is a container type, this function will call itself recursively and contain all contents. Tip: When sending multiple AMF objects in one go, put them in a single AMF::AMF0_DDV_CONTAINER for easy transfer.

std::string AMF::Object3::Print ( std::string  indent = "")
std::string AMF::Object3::Print ( std::string  indent = "")

Return the contents as a human-readable string.

If this object contains other objects, it will call itself recursively and print all nested content as well.

const char* AMF::Object3::Str ( )
const char * AMF::Object3::Str ( )

Returns the C-string value of this object, if available.

If this object holds no string value, an empty C-string is returned.

std::string AMF::Object3::StrValue ( )

Returns the std::string value of this object, if available.

If this object holds no string value, an empty string is returned.

std::string AMF::Object3::StrValue ( )

Field Documentation

std::vector< Object3 > AMF::Object3::contents
protected

Holds this objects contents, if any (for container types).

double AMF::Object3::dblval
protected

Holds this objects double value, if any.

int AMF::Object3::intval
protected

Holds this objects int value, if any.

std::string AMF::Object3::myIndice
protected

Holds this objects indice, if any.

obj3type AMF::Object3::myType
protected

Holds this objects AMF0 type.

std::string AMF::Object3::strval
protected

Holds this objects string value, if any.


The documentation for this class was generated from the following files: