Main Page | Class List | Directories | File List | Class Members | File Members

wxScriptVar Class Reference

A variable object containing both info about its type (using wxScriptTypeInfo) and the contents of the variable. More...

#include <script.h>

List of all members.

Public Member Functions

 wxScriptVar (const wxScriptVar &var)
 Copy constructor.
 wxScriptVar (const wxString &type=wxEmptyString, const wxString &content=wxEmptyString)
 wxScriptVar (const wxString &type, int *pointer)
 This constructor is used to init this variable as a pointer.
virtual ~wxScriptVar ()
wxScriptVaroperator= (const wxScriptVar &tocopy)
virtual void SetType (const wxString &str)
 Sets the type of this variable; wxScriptTypeInfo::Set() is used.
virtual void SetContent (const wxString &)
 Sets the contents of this variable using the given string.
virtual void SetContent (const wxChar *str)
virtual void SetContent (wxChar *str)
virtual void SetContent (long l)
virtual void SetContent (double l)
virtual void SetContent (bool l)
virtual void SetContent (void *l)
virtual void SetContent (const void *l)
void Set (const wxString &type, const wxString &content)
 Changes both type & content of this variable.
void Set (wxScriptTypeGeneric type, char *content)
void Set (wxScriptTypeGeneric type, long content)
void Set (wxScriptTypeGeneric type, double content)
void Set (wxScriptTypeGeneric type, bool content)
void Set (wxScriptTypeGeneric type, void *content)
void Set (wxScriptTypeGeneric type, const wxString &content)
virtual void ResetContent ()
 Sets as empty the current contents (deleting eventually allocated memory).
virtual void Copy (const wxScriptVar &var)
 Copies the given wxScriptVar object.
wxScriptTypeInfo GetType () const
 Returns the type of this variable.
long GetContentLong () const
 Returns the contents of this variable as LONG.
double GetContentDouble () const
 Returns the contents of this variable as a DOUBLE.
virtual wxString GetContentString () const
 Returns the contents encoded in a string.
virtual void * GetPointer () const
 Returns the memory address hold by this variable if it is set as a pointer.

Protected Attributes

wxScriptTypeInfo m_tType
 The type of this variable.
long m_content
double m_floatcontent


Detailed Description

A variable object containing both info about its type (using wxScriptTypeInfo) and the contents of the variable.


Constructor & Destructor Documentation

wxScriptVar::wxScriptVar const wxScriptVar var  )  [inline]
 

Copy constructor.

wxScriptVar::wxScriptVar const wxString &  type = wxEmptyString,
const wxString &  content = wxEmptyString
[inline]
 

wxScriptVar::wxScriptVar const wxString &  type,
int *  pointer
[inline]
 

This constructor is used to init this variable as a pointer.

The given type string must end with "*" and the given memory address must be cast to "int *" to avoid ambiguity with the previous constructor.

Example: myClass test; wxScriptVar arg1("myClass *", (int *)(&test));

virtual wxScriptVar::~wxScriptVar  )  [inline, virtual]
 


Member Function Documentation

void wxScriptVar::Copy const wxScriptVar var  )  [virtual]
 

Copies the given wxScriptVar object.

double wxScriptVar::GetContentDouble  )  const [inline]
 

Returns the contents of this variable as a DOUBLE.

long wxScriptVar::GetContentLong  )  const [inline]
 

Returns the contents of this variable as LONG.

wxString wxScriptVar::GetContentString  )  const [virtual]
 

Returns the contents encoded in a string.

The content encoding is done using the current type set. This function uses the same encode rules used to decode the content by the SetContent(const wxString &) function.

virtual void* wxScriptVar::GetPointer  )  const [inline, virtual]
 

Returns the memory address hold by this variable if it is set as a pointer.

wxScriptTypeInfo wxScriptVar::GetType  )  const [inline]
 

Returns the type of this variable.

wxScriptVar& wxScriptVar::operator= const wxScriptVar tocopy  )  [inline]
 

void wxScriptVar::ResetContent  )  [virtual]
 

Sets as empty the current contents (deleting eventually allocated memory).

void wxScriptVar::Set wxScriptTypeGeneric  type,
const wxString &  content
[inline]
 

void wxScriptVar::Set wxScriptTypeGeneric  type,
void *  content
[inline]
 

void wxScriptVar::Set wxScriptTypeGeneric  type,
bool  content
[inline]
 

void wxScriptVar::Set wxScriptTypeGeneric  type,
double  content
[inline]
 

void wxScriptVar::Set wxScriptTypeGeneric  type,
long  content
[inline]
 

void wxScriptVar::Set wxScriptTypeGeneric  type,
char *  content
[inline]
 

void wxScriptVar::Set const wxString &  type,
const wxString &  content
[inline]
 

Changes both type & content of this variable.

virtual void wxScriptVar::SetContent const void *  l  )  [inline, virtual]
 

virtual void wxScriptVar::SetContent void *  l  )  [inline, virtual]
 

virtual void wxScriptVar::SetContent bool  l  )  [inline, virtual]
 

virtual void wxScriptVar::SetContent double  l  )  [inline, virtual]
 

virtual void wxScriptVar::SetContent long  l  )  [inline, virtual]
 

virtual void wxScriptVar::SetContent wxChar *  str  )  [inline, virtual]
 

virtual void wxScriptVar::SetContent const wxChar *  str  )  [inline, virtual]
 

void wxScriptVar::SetContent const wxString &   )  [virtual]
 

Sets the contents of this variable using the given string.

The content decoding is done using the current type set. This function uses the same decode rules used to encode the content by the GetContentString() function; so, no loss of data should happen if you do:

                wxScriptVar myvar("bool", "false");
                myvar.SetContent(myvar.GetContentString());

virtual void wxScriptVar::SetType const wxString &  str  )  [inline, virtual]
 

Sets the type of this variable; wxScriptTypeInfo::Set() is used.


Member Data Documentation

long wxScriptVar::m_content [protected]
 

double wxScriptVar::m_floatcontent [protected]
 

wxScriptTypeInfo wxScriptVar::m_tType [protected]
 

The type of this variable.


The documentation for this class was generated from the following files:
Generated on Wed Jul 6 20:21:28 2005 for wxScript by  doxygen 1.4.3