00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Mark Elendt 00008 * Side Effects Software Inc. 00009 * 20 Maud St. 00010 * Toronto, Ontario, M5V 2M5 00011 * Canada 00012 * 416-366-4607 00013 * 00014 * NAME: CMD library (C++) 00015 * 00016 * COMMENTS: Alias handling for CMD library 00017 * 00018 */ 00019 00020 #ifndef __CMD_Alias_H__ 00021 #define __CMD_Alias_H__ 00022 00023 #include "CMD_API.h" 00024 #include "CMD_SymbolList.h" 00025 00026 class CMD_Alias; 00027 00028 class CMD_API CMD_AliasTable : public CMD_SymbolList 00029 { 00030 public: 00031 CMD_AliasTable(); 00032 virtual ~CMD_AliasTable(); 00033 00034 bool hasAlias(const char *name) 00035 { 00036 return hasValue(name); 00037 } 00038 bool getAlias(const char *name, UT_String &value) 00039 { 00040 return getValue(name, value); 00041 } 00042 void setAlias(const char *name, const char *value) 00043 { 00044 setValue(name, value, /*export_var=*/false); 00045 } 00046 int destroyAlias(const char *name) 00047 { 00048 return destroySymbol(name); 00049 } 00050 int getAliasNames(UT_StringArray &nameList) 00051 { 00052 return getSymbolNames(nameList); 00053 } 00054 00055 private: 00056 virtual int isValidSymbolName(const char *name) const; 00057 virtual CMD_SymbolEntry *createEntry(const char *name, 00058 const char *value, 00059 bool export_var); 00060 00061 void save(CMD_Manager *cman, ostream &os); 00062 friend class CMD_Manager; // For save 00063 00064 private: 00065 UT_SymbolTable *myTable; 00066 }; 00067 00068 #endif
1.5.9