00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __GOP_AttribListParse_h__
00019 #define __GOP_AttribListParse_h__
00020
00021 #include "GOP_API.h"
00022 #include <UT/UT_PtrArray.h>
00023 #include <GEO/GEO_AttributeOwner.h>
00024
00025 class UT_String;
00026 class GB_Attribute;
00027 class GB_AttributeDict;
00028 class GEO_AttributeHandleList;
00029
00030 enum GOP_AttribParseError
00031 {
00032 GOP_AP_ERROR_NONE = 0,
00033 GOP_AP_ERROR_ATTRIB_UNKNOWN,
00034 GOP_AP_ERROR_ATTRIB_DUPLICATED,
00035 GOP_AP_ERROR_ATTRIB_REDUNDANT,
00036 GOP_AP_ERROR_PATTERN_MATCH_UNSUPPORTED,
00037 GOP_AP_ERROR_INCOMPATIBLE_ATTRIBUTE_LIST_STRING_PATTERNS
00038 };
00039
00040 typedef void (*GOP_AttribParseErrorCallback) (GOP_AttribParseError,
00041 const char *, void *);
00042 typedef bool (*GOP_AttribParseConfirmCallback) (const GB_Attribute *,
00043 void *);
00044
00045
00046
00047 class GOP_API GOP_AttribListParse
00048 {
00049 public:
00050
00051
00052
00053
00054
00055
00056 static int parsePAndPw(UT_String &attriblist,
00057 GOP_AttribParseErrorCallback errorCB = 0);
00058
00059
00060
00061
00062
00063
00064
00065 static bool isAttribListValid(const GB_AttributeDict &dict,
00066 const UT_String &attriblist,
00067 GOP_AttribParseErrorCallback errorCB = 0,
00068 void *errordata = 0, UT_String *badlist = 0);
00069
00070
00071
00072
00073
00074 static void parseAttribList(const GB_AttributeDict &dict,
00075 UT_String &attriblist,
00076 UT_PtrArray<GB_Attribute *> &attribarray,
00077 GOP_AttribParseConfirmCallback confirmCB = 0,
00078 void *confirmdata = 0,
00079 GOP_AttribParseErrorCallback errorCB = 0,
00080 void *errordata = 0);
00081
00082
00083
00084
00085
00086 static void parseAttribList(GEO_AttributeHandleList &attriblist,
00087 GEO_AttributeOwner owner,
00088 UT_String &attriblist_str,
00089 GOP_AttribParseConfirmCallback confirmCB=0,
00090 void *confirmdata = 0,
00091 GOP_AttribParseErrorCallback errorCB = 0,
00092 void *errordata = 0);
00093
00094
00095
00096
00097
00098
00099 static char *renameAttrib(UT_String &attrib,
00100 const UT_String &inattriblist,
00101 const UT_String &outattriblist,
00102 GOP_AttribParseErrorCallback errorCB = 0,
00103 void *errordata = 0);
00104 };
00105
00106 #endif