16 using namespace kome::objects;
21 #define new new( _NORMAL_BLOCK, __FILE__, __LINE__ )
22 #define malloc( s ) _malloc_dbg( s, _NORMAL_BLOCK, __FILE__, __LINE__ )
43 if( var.
arr !=
NULL && var.prim.intVal > 0 ) {
44 int size = var.prim.intVal;
45 if( var.
type == ARRAY ) {
47 for(
int i = 0; i < size; i++ ) {
51 else if( var.
type == STRING ) {
52 arr =
new char[ size ];
53 memcpy(
arr, var.
arr, size );
72 if( other.
arr !=
NULL && other.prim.intVal > 0 ) {
73 int size = other.prim.intVal;
74 if( other.
type == ARRAY ) {
76 for(
int i = 0; i < size; i++ ) {
80 else if( other.
type == STRING ) {
81 arr =
new char[ size ];
82 memcpy(
arr, other.
arr, size );
106 int size = strlen( s ) + 1;
107 arr =
new char[ size ];
111 memcpy(
arr, s, size );
150 if( index >= (
unsigned int)prim.intVal ) {
164 return (
unsigned int)prim.intVal;
Variant * getArray()
gets array
Variant * getElement(const unsigned int index)
gets element of the array
interfaces of Variant class
Variant * createArray(const unsigned int size)
creates array
void deleteArray()
deletes array
Variant & operator=(const Variant &other)
substitution operator
class that treats data of various types
void setString(const char *s)
sets character string
virtual ~Variant()
destructor
unsigned int getArraySize()
gets array size
char * getString()
gets character string