HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
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
21
enum
GOP_AttribParseError
22
{
23
GOP_AP_ERROR_NONE
= 0,
24
GOP_AP_ERROR_ATTRIB_UNKNOWN
,
25
GOP_AP_ERROR_ATTRIB_DUPLICATED
,
26
GOP_AP_ERROR_ATTRIB_REDUNDANT
,
27
GOP_AP_ERROR_PATTERN_MATCH_UNSUPPORTED
,
28
GOP_AP_ERROR_INCOMPATIBLE_ATTRIBUTE_LIST_STRING_PATTERNS
29
};
30
31
typedef
void
(*
GOP_AttribParseErrorCallback
) (
GOP_AttribParseError
,
32
const
char
*,
void
*);
33
typedef
bool (*
GOP_AttribParseConfirmCallback
) (
const
GA_Attribute
*,
34
void
*);
35
36
//___________________________________________________________________________
37
38
class
GOP_API
GOP_AttribListParse
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,
54
GOP_AttribParseErrorCallback
errorCB,
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
// NOTE: Returning false may just be warnings such as the same attribute
61
// showing up explicitly multiple times. You probably want to process
62
// the attributes even if this is false!
63
// ERRORS:
64
// GOP_AP_ERROR_ATTRIB_UNKNOWN
65
// GOP_AP_ERROR_ATTRIB_DUPLICATED
66
static
bool
isAttribListValid(
const
GA_AttributeDict
&dict,
67
const
UT_StringRef
&attriblist,
68
GOP_AttribParseErrorCallback
errorCB = 0,
69
void
*errordata = 0,
UT_String
*badlist = 0);
70
71
// Parses the attribute list string and extracts the attribute pointers
72
// into the supplied array.
73
// ERRORS:
74
// GOP_AP_ERROR_PATTERN_MATCH_UNSUPPORTED (warning)
75
static
void
parseAttribList(
const
GA_AttributeDict
&dict,
76
const
UT_StringRef
&attriblist,
77
UT_Array<GA_Attribute *>
&attribarray,
78
GOP_AttribParseConfirmCallback
confirmCB = 0,
79
void
*confirmdata = 0,
80
GOP_AttribParseErrorCallback
errorCB = 0,
81
void
*errordata = 0,
82
const
GA_AttributeFilter
*
filter
= 0);
83
84
// Pattern matches the incoming attribute string with the input attribute
85
// list string and returns the corresponding outgoing attribute string
86
// from the output attribute list string.
87
// ERRORS:
88
// GOP_AP_ERROR_INCOMPATIBLE_ATTRIBUTE_LIST_STRING_PATTERNS
89
static
char
*renameAttrib(
UT_String
&attrib,
90
const
UT_String
&inattriblist,
91
const
UT_String
&outattriblist,
92
GOP_AttribParseErrorCallback
errorCB = 0,
93
void
*errordata = 0);
94
95
// Returns true if the attribute name is valid according to the
96
// atrib list stirng.
97
static
bool
isAttribAllowedByString(
const
UT_StringRef
&attrib,
const
UT_StringRef
&attriblist_ref);
98
};
99
100
#endif
GOP_AP_ERROR_ATTRIB_UNKNOWN
Definition:
GOP_AttribListParse.h:24
GA_Attribute
Definition of a geometry attribute.
Definition:
GA_Attribute.h:198
GOP_AttribParseConfirmCallback
bool(* GOP_AttribParseConfirmCallback)(const GA_Attribute *, void *)
Definition:
GOP_AttribListParse.h:33
void
void
Definition:
png.h:1083
GOP_AP_ERROR_ATTRIB_REDUNDANT
Definition:
GOP_AttribListParse.h:26
UT_StringRef
Definition:
UT_StringHolder.h:188
UT_Array< GA_Attribute * >
GOP_AttribListParse
Definition:
GOP_AttribListParse.h:38
GOP_API
#define GOP_API
Definition:
GOP_API.h:10
GA_AttributeDict
A string map of attributes to ease backward compatibility In the GB/GEO/GU library code would often p...
Definition:
GA_AttributeDict.h:42
GOP_AP_ERROR_NONE
Definition:
GOP_AttribListParse.h:23
GOP_AP_ERROR_PATTERN_MATCH_UNSUPPORTED
Definition:
GOP_AttribListParse.h:27
UT_ValArray.h
GOP_AP_ERROR_INCOMPATIBLE_ATTRIBUTE_LIST_STRING_PATTERNS
Definition:
GOP_AttribListParse.h:28
GOP_AttribParseError
GOP_AttribParseError
Definition:
GOP_AttribListParse.h:21
UT_StringHolder.h
GA_AttributeFilter
Definition:
GA_AttributeFilter.h:54
GOP_AP_ERROR_ATTRIB_DUPLICATED
Definition:
GOP_AttribListParse.h:25
UT_String
Definition:
UT_String.h:73
GA_Types.h
GOP_AttribParseErrorCallback
void(* GOP_AttribParseErrorCallback)(GOP_AttribParseError, const char *, void *)
Definition:
GOP_AttribListParse.h:31
GOP_AttribListParse::parsePAndPw
static int parsePAndPw(UT_String &attriblist, GOP_AttribParseErrorCallback errorCB=0)
Definition:
GOP_AttribListParse.h:47
GOP_API.h
filter
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition:
glcorearb.h:1297
GOP
GOP_AttribListParse.h
Generated on Tue Dec 17 2024 03:39:43 for HDK by
1.8.6