HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GOP_AttribListParse.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  */
7 
8 #ifndef __GOP_AttribListParse_h__
9 #define __GOP_AttribListParse_h__
10 
11 #include "GOP_API.h"
12 #include <UT/UT_ValArray.h>
13 #include <UT/UT_StringHolder.h>
14 #include <GA/GA_Types.h>
15 
16 class UT_String;
17 class GA_Attribute;
18 class GA_AttributeDict;
19 class GA_AttributeFilter;
20 
22 {
29 };
30 
32  const char *, void *);
34  void *);
35 
36 //___________________________________________________________________________
37 
39 {
40 public:
41  // Parses attribute list string to match "P" and "Pw". Returns 0 if
42  // no match, 3 if "P" matches but not "Pw", and 4 if "Pw" matches.
43  // Also removes instances of "P" and "Pw" from the string.
44  // ERRORS:
45  // GOP_AP_ERROR_ATTRIB_DUPLICATED
46  // GOP_AP_ERROR_ATTRIB_REDUNDANT
47  static int parsePAndPw(UT_String &attriblist,
48  GOP_AttribParseErrorCallback errorCB = 0)
49  {
50  return parsePAndPw(attriblist, errorCB, 0);
51  }
52 
53  static int parsePAndPw(UT_String &attriblist,
55  void *errordata);
56 
57  // Parses attribute list string and verifies syntax as well as the
58  // existence of the attributes specified. Can return the nonexistent
59  // attributes in the badlist parameter.
60  // ERRORS:
61  // GOP_AP_ERROR_ATTRIB_UNKNOWN
62  // GOP_AP_ERROR_ATTRIB_DUPLICATED
63  static bool isAttribListValid(const GA_AttributeDict &dict,
64  const UT_String &attriblist,
65  GOP_AttribParseErrorCallback errorCB = 0,
66  void *errordata = 0, UT_String *badlist = 0);
67 
68  // Parses the attribute list string and extracts the attribute pointers
69  // into the supplied array.
70  // ERRORS:
71  // GOP_AP_ERROR_PATTERN_MATCH_UNSUPPORTED (warning)
72  static void parseAttribList(const GA_AttributeDict &dict,
73  const UT_String &attriblist,
74  UT_Array<GA_Attribute *> &attribarray,
75  GOP_AttribParseConfirmCallback confirmCB = 0,
76  void *confirmdata = 0,
77  GOP_AttribParseErrorCallback errorCB = 0,
78  void *errordata = 0,
79  const GA_AttributeFilter *filter = 0);
80 
81  // Pattern matches the incoming attribute string with the input attribute
82  // list string and returns the corresponding outgoing attribute string
83  // from the output attribute list string.
84  // ERRORS:
85  // GOP_AP_ERROR_INCOMPATIBLE_ATTRIBUTE_LIST_STRING_PATTERNS
86  static char *renameAttrib(UT_String &attrib,
87  const UT_String &inattriblist,
88  const UT_String &outattriblist,
89  GOP_AttribParseErrorCallback errorCB = 0,
90  void *errordata = 0);
91 
92  // Returns true if the attribute name is valid according to the
93  // atrib list stirng.
94  static bool isAttribAllowedByString(const UT_StringRef &attrib, const UT_StringRef &attriblist_ref);
95 };
96 
97 #endif
Definition of a geometry attribute.
Definition: GA_Attribute.h:190
bool(* GOP_AttribParseConfirmCallback)(const GA_Attribute *, void *)
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
#define GOP_API
Definition: GOP_API.h:10
A string map of attributes to ease backward compatibility In the GB/GEO/GU library code would often p...
GOP_AttribParseError
void(* GOP_AttribParseErrorCallback)(GOP_AttribParseError, const char *, void *)
static int parsePAndPw(UT_String &attriblist, GOP_AttribParseErrorCallback errorCB=0)
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glcorearb.h:1296