The HUserOptions class is a helper class which wraps up memory management for variable size user options returned from HOOPS. More...
#include <HUtility.h>
Public Member Functions | |
HUserOptions () | |
HUserOptions (const HUserOptions &in_data) | |
bool | IsValid () |
const char * | Show_Net_User_Options () |
const char * | Show_One_Net_User_Option (const char *which) |
const char * | Show_One_User_Option (const char *which) |
const char * | Show_User_Options () |
~HUserOptions () | |
Public Attributes | |
char * | m_data |
actual char* to the user options | |
int | m_length |
length of current user option | |
bool | m_valid |
The HUserOptions class is a helper class which wraps up memory management for variable size user options returned from HOOPS.
HUserOptions uses Show_User_Option_Length (or variation) to get the length of user option and manages memory allocation and free for Show_User_Option. Following shows an example usage
without HUserOption class: problem is assumption that option is max 1024 char * options[MVO_BUFFER_SIZE]; HC_Show_User_Option(options); if( strstr(options, "true") return true;
with HUserOption class: automatically allocates enough memory required (by using Show_XXX_Length routene) and free the memory in the destructor HUserOptions options; options.Show_User_Option(); if( strstr(options.m_data, "true") return true;
HUserOptions::HUserOptions | ( | ) |
constructor
HUserOptions::HUserOptions | ( | const HUserOptions & | in_data | ) |
copy constructor
HUserOptions::~HUserOptions | ( | ) |
destructor
bool HUserOptions::IsValid | ( | ) |
IsValid returns true if the user option held in this object is valid i.e. if m_length > 0
const char* HUserOptions::Show_Net_User_Options | ( | ) |
Show_Net_User_Options Wraps HC_Show_Net_User_Options to use Show_XXX_Length routene and perform memory management. Please refer to the documentation of HC_Show_Net_User_Options from HOOPS/3dGS reference manual for details
const char* HUserOptions::Show_One_Net_User_Option | ( | const char * | which | ) |
Show_One_Net_User_Option Wraps HC_Show_One_Net_User_Option to use Show_XXX_Length routene and perform memory management. Please refer to the documentation of HC_Show_One_Net_User_Option from HOOPS/3dGS reference manual for details
const char* HUserOptions::Show_One_User_Option | ( | const char * | which | ) |
Show_One_User_Option Wraps HC_Show_One_User_Option to use Show_XXX_Length routene and perform memory management. Please refer to the documentation of HC_Show_One_User_Option from HOOPS/3dGS reference manual for details
const char* HUserOptions::Show_User_Options | ( | ) |
Show_User_Options Wraps HC_Show_User_Options to use Show_XXX_Length routene and perform memory management. Please refer to the documentation of HC_Show_User_Options from HOOPS/3dGS reference manual for details