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 * Side Effects Software Inc. 00008 * 477 Richmond Street West, Suite 1001 00009 * Toronto, Ontario 00010 * Canada M5V 3E7 00011 * 416-504-9876 00012 */ 00013 00014 #ifndef __SIM_RootData_h__ 00015 #define __SIM_RootData_h__ 00016 00017 #include "SIM_API.h" 00018 #include "SIM_DataUtils.h" 00019 00020 class SIM_RootDataId; 00021 00022 class SIM_API SIM_RootData : public SIM_Data 00023 { 00024 public: 00025 /// Returns the name of the root data. The method for setting the name 00026 /// is provided in the subclasses because the rules for when and how 00027 /// this name can be set depends on the subclass type. 00028 const UT_String &getName() const; 00029 00030 /// Determines if this root data is a match for the pattern string 00031 /// passed in. The string must be a single token, not a series of 00032 /// tokens, but wildcards are allowed. This function just calls 00033 /// getMatchesStringSubclass(). 00034 bool getMatchesString(const char *pattern) const; 00035 00036 /// Fills out the root data identifier by calling getRootDataIdSubclass(). 00037 void getRootDataId(SIM_RootDataId &id) const; 00038 00039 /// Returns the full path (including the path to this root data) 00040 /// for the specified subdata. 00041 void appendFullDataPath(const SIM_Data *subdata, 00042 bool useobjectid, 00043 UT_String &datapath) const; 00044 00045 /// Forces the value of the passed in string to contain a value that 00046 /// represents a valid root data name. Currently valid root data names 00047 /// are the same as valid variable names. 00048 static void forceValidRootDataName(UT_String &rootdataname); 00049 00050 protected: 00051 SIM_RootData(const SIM_DataFactory *factory); 00052 virtual ~SIM_RootData(); 00053 00054 /// This function returns whether this data matches the string pattern. 00055 /// This function must be overridden by subclasses. 00056 virtual bool getMatchesStringSubclass(const char *pattern) const=0; 00057 /// This function fills out the SIM_RootDataId structure with the 00058 /// unique identifier information for this root data. 00059 virtual void getRootDataIdSubclass(SIM_RootDataId &id) const=0; 00060 00061 UT_String myName; 00062 00063 private: 00064 DECLARE_STANDARD_GETCASTTOTYPE(); 00065 DECLARE_CLASSNAME(SIM_RootData, SIM_Data); 00066 }; 00067 00068 #endif 00069
1.5.9