SML::STRING Class Reference

SML string constant representation. More...

#include <sml/string.h>

Inheritance diagram for SML::STRING:
Inheritance graph
[legend]

List of all members.

Public Member Functions

void AddRef ()
void AttachUserData (USERDATA *data)
 DEPRECATED_MSG ("Use Assign instead") void SetString(const char *str)
 DEPRECATED_MSG ("Just construct a STRUTF8 from *smlstr") STRUTF8 GetSTRUTF8() const
void DetachUserData (USERDATA *data)
int FlagTextToValueMultiple (const PARM *flags, UINT32 *FlagVal) const
int FlagTextToValueMultiple (const FLAG *flags, UINT32 *FlagVal) const
int FlagTextToValueSingle (const PARM *flags, UINT32 *FlagVal) const
int FlagTextToValueSingle (const FLAG *flags, UINT32 *FlagVal) const
int FlagValueToTextMultiple (const PARM *flags, UINT32 *FlagVal)
int FlagValueToTextMultiple (const FLAG *flags, UINT32 *FlagVal)
int FlagValueToTextSingle (const PARM *flags, UINT32 *FlagVal)
int FlagValueToTextSingle (const FLAG *flags, UINT32 *FlagVal)
USERDATAGetUserData (USERDATA::TAG tag)
void Release ()

Detailed Description

SML string constant representation.

Note:
The constructors are private. Use the various SML::CONTEXT::StringAlloc() methods instead.

Member Function Documentation

void SML::STRING::AddRef (  ) 

Increment refcount.

void SML::STRING::AttachUserData ( USERDATA data  ) 

Attach some User Data to the string.

The data to be attached must be derived from SML::USERDATA, and must have been allocated via "new". Once attached to the string, the string owns the data and will "delete" it when the string is deleted. Also, if you try to attach something for a user ID that's already in use, it will delete the existing thing.

SML::STRING::DEPRECATED_MSG ( "Use Assign instead"   )  const

(char*) version assumes ISO-2022.

SML::STRING::DEPRECATED_MSG ( "Just construct a STRUTF8 from *smlstr"   )  const

Get STRUTF8 instance for string.

Returns:
Temporary STRUTF8 instance.
void SML::STRING::DetachUserData ( USERDATA data  ) 

Detach some User Data from the string.

If the data to be unattached isn't attached, it just ignores you. Once detached, the data is yours to do with as you wish. You are responsible for deleting it too.

int SML::STRING::FlagTextToValueMultiple ( const PARM flags,
UINT32 FlagVal 
) const

Lookup multiple string values in an array of SML::FLAGS.

This method is just like the other one of the same name, but takes an SML::PARM and gets the SML::FLAG array from it instead.

Parameters:
flags an SML::PARM which contains an SML::FLAG array
FlagVal flag value returned
int SML::STRING::FlagTextToValueMultiple ( const FLAG flags,
UINT32 FlagVal 
) const

Lookup multiple string values in an array of SML::FLAGS.

This method is like FlagTextToValueSingle except that the string may contain multiple flags seperated by commas and/or whitespace. This is intended for flags which are bit-field values that you would use bitwise or to combine in C or C++

Returns:
-1 if the any of the flags could not be found in the SML::FLAG array, 0 if all were found
Parameters:
flags SML::FLAG array describing possible values
FlagVal flag value returned
int SML::STRING::FlagTextToValueSingle ( const PARM flags,
UINT32 FlagVal 
) const

Lookup a string value in an array of SML::FLAGS.

This method is just like the other one of the same name, but takes an SML::PARM and gets the SML::FLAG array from it instead.

Parameters:
flags an SML::PARM which contains an SML::FLAG array
FlagVal flag value returned
int SML::STRING::FlagTextToValueSingle ( const FLAG flags,
UINT32 FlagVal 
) const

Lookup a string value in an array of SML::FLAGS.

In an SML function, a parameter may be defined to be STYPE_String even though internally you want a number. This function allows you to look up the value in an array of SML::FLAGs

Returns:
-1 if the string could not be found in the SML::FLAG array, 0 if it could
Parameters:
flags SML::FLAG array describing possible values
FlagVal flag value returned
int SML::STRING::FlagValueToTextMultiple ( const PARM flags,
UINT32 FlagVal 
)

Lookup multiple flag values in an array of SML::FLAGS.

This method is just like the other one of the same name, but takes an SML::PARM and gets the SML::FLAG array from it instead.

Parameters:
flags an SML::PARM which contains an SML::FLAG array
FlagVal flag value returned
int SML::STRING::FlagValueToTextMultiple ( const FLAG flags,
UINT32 FlagVal 
)

Lookup multiple flag values in an array of SML::FLAGS.

This method is like FlagTextToValueSingle except that the string may contain multiple flags seperated by commas and/or whitespace. This is intended for flags which are bit-field values that you would use bitwise or to combine in C or C++

Returns:
-1 if the any of the flags could not be found in the SML::FLAG array, 0 if all were found
Parameters:
flags SML::FLAG array describing possible values
FlagVal flag value returned
int SML::STRING::FlagValueToTextSingle ( const PARM flags,
UINT32 FlagVal 
)

Lookup a flag value in an array of SML::FLAGS.

This method is just like the other one of the same name, but takes an SML::PARM and gets the SML::FLAG array from it instead.

Parameters:
flags an SML::PARM which contains an SML::FLAG array
FlagVal flag value returned
int SML::STRING::FlagValueToTextSingle ( const FLAG flags,
UINT32 FlagVal 
)

Lookup a flag value in an array of SML::FLAGS.

In an SML function, a parameter may be defined to be STYPE_String even though internally you have a number. This function allows you to look up the string in an array of SML::FLAGs

Returns:
-1 if the string could not be found in the SML::FLAG array, 0 if it could
Parameters:
flags SML::FLAG array describing possible values
FlagVal flag value returned
USERDATA* SML::STRING::GetUserData ( USERDATA::TAG  tag  ) 

Get the User Data attached to a string.

If no data for the given id is attached, it will just return NULL . Do not free the data returned unless you Unattach it first.

void SML::STRING::Release (  ) 

Decrement refcount. If it goes to zero, string deletes itself.


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

Generated on Sun Oct 7 21:39:18 2012 for TNTsdk 2012 by  doxygen 1.6.1