HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PRM_PresetInfo Class Reference

#include <PRM_PresetInfo.h>

Public Member Functions

 PRM_PresetInfo (const char *subdir, const char *file)
 
virtual ~PRM_PresetInfo ()
 
void setIndexFile (const char *subdir)
 
void setNeedsRefresh ()
 
int getNumPresets ()
 
const UT_StringgetPresetName (int i)
 
const UT_StringgetPresetPath (int i)
 
const UT_StringgetPresetFile ()
 
const UT_StringgetPresetSection ()
 
int getDefaultPreset ()
 
int getPresetIndex (const char *presetname)
 
bool deletePresetFromDir (const char *name, const char *dir=0)
 
bool savePresetToDir (PRM_ParmList *parmlist, const char *name, const char *dir)
 
bool loadPresetFile (PRM_ParmList *parmlist, const char *filename)
 
bool savePresetFile (PRM_ParmList *parmlist, const char *filename)
 
bool savePreset (PRM_ParmList *parmlist, std::ostream &os)
 
bool loadPreset (PRM_ParmList *parmlist, UT_IStream &is)
 

Static Public Member Functions

static void makeValidPresetFileName (UT_String &filename)
 
static const UT_StringArraygetValidSaveDirs ()
 
static bool loadPresetContents (PRM_ParmList *parmlist, const char *token, UT_IStream &is)
 

Detailed Description

Definition at line 30 of file PRM_PresetInfo.h.

Constructor & Destructor Documentation

PRM_PresetInfo::PRM_PresetInfo ( const char *  subdir,
const char *  file 
)

Subdir is the name of the sub directory where the preset file can be found. Since presets can be also loaded from HDAs, subdir is synonymous with the operator table name (eg "Object"), except it can contain version which the constructor strips off (eg, "Object12.5.100", used for operator state parm dialogs. File is the preset file name, which is the same as the operator type it applies to (eg "myhda" or "ns::hda::1.0), the file name will be groomed to ensure it is a valid file name (eg, "myhda" or "ns-hda-1.0". By providing the unaltered optype name, it is possible to locate presets inside the HDA sections, which otherwise would be more difficult for namespaced optypes.

virtual PRM_PresetInfo::~PRM_PresetInfo ( )
virtual

Member Function Documentation

bool PRM_PresetInfo::deletePresetFromDir ( const char *  name,
const char *  dir = 0 
)
int PRM_PresetInfo::getDefaultPreset ( )
int PRM_PresetInfo::getNumPresets ( )
const UT_String& PRM_PresetInfo::getPresetFile ( )
int PRM_PresetInfo::getPresetIndex ( const char *  presetname)
const UT_String& PRM_PresetInfo::getPresetName ( int  i)
const UT_String& PRM_PresetInfo::getPresetPath ( int  i)
const UT_String& PRM_PresetInfo::getPresetSection ( )
static const UT_StringArray& PRM_PresetInfo::getValidSaveDirs ( )
static
bool PRM_PresetInfo::loadPreset ( PRM_ParmList parmlist,
UT_IStream is 
)
static bool PRM_PresetInfo::loadPresetContents ( PRM_ParmList parmlist,
const char *  token,
UT_IStream is 
)
static
bool PRM_PresetInfo::loadPresetFile ( PRM_ParmList parmlist,
const char *  filename 
)
static void PRM_PresetInfo::makeValidPresetFileName ( UT_String filename)
static
bool PRM_PresetInfo::savePreset ( PRM_ParmList parmlist,
std::ostream &  os 
)
bool PRM_PresetInfo::savePresetFile ( PRM_ParmList parmlist,
const char *  filename 
)
bool PRM_PresetInfo::savePresetToDir ( PRM_ParmList parmlist,
const char *  name,
const char *  dir 
)
void PRM_PresetInfo::setIndexFile ( const char *  subdir)
void PRM_PresetInfo::setNeedsRefresh ( )

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