VTK
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtkParseExtras.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkParseExtras.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*-------------------------------------------------------------------------
16  Copyright (c) 2011 David Gobbi.
17 
18  Contributed to the VisualizationToolkit by the author in May 2011
19  under the terms of the Visualization Toolkit 2008 copyright.
20 -------------------------------------------------------------------------*/
21 
26 #ifndef VTK_PARSE_EXTRAS_H
27 #define VTK_PARSE_EXTRAS_H
28 
29 #include "vtkParseData.h"
30 #include <stddef.h>
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
41 size_t vtkParse_IdentifierLength(const char *text);
42 
49 size_t vtkParse_NameLength(const char *text);
50 
56 size_t vtkParse_UnscopedNameLength(const char *text);
57 
63 size_t vtkParse_LiteralLength(const char *text);
64 
74  const char *text, unsigned int *type,
75  const char **classname, size_t *classname_len);
76 
83  ValueInfo *val, StringCache *cache, const char *text);
84 
91 const char *vtkParse_ValueInfoToString(ValueInfo *val, int *nf);
92 
97 void vtkParse_ExpandTypedef(ValueInfo *valinfo, ValueInfo *typedefinfo);
98 
104  ValueInfo *valinfo, StringCache *cache,
105  int n, const char *name[], const char *val[],
106  ValueInfo *typedefinfo[]);
107 
114  ValueInfo *valinfo, StringCache *cache,
115  int n, const char *name[], const char *val[]);
116 
120 const char *vtkParse_StringReplace(
121  const char *str1, int n, const char *name[], const char *val[]);
122 
129  const char *text, const char **classname,
130  int n, const char ***args, const char *defaults[]);
131 
136  const char *classname, int n, const char **args);
137 
146  ClassInfo *data, StringCache *cache, int n, const char *args[]);
147 
156  FunctionInfo *data, int n, const char *args[]);
157 
161 const char **vtkParse_GetTemplateMacroTypes();
162 
166 const char **vtkParse_GetArrayTypes();
167 
168 
169 #ifdef __cplusplus
170 } /* extern "C" */
171 #endif
172 
173 #endif
void vtkParse_ExpandTypedefs(ValueInfo *valinfo, StringCache *cache, int n, const char *name[], const char *val[], ValueInfo *typedefinfo[])
Expand any unrecognized types within a variable, parameter, or typedef that match any of the supplied...
void vtkParse_InstantiateClassTemplate(ClassInfo *data, StringCache *cache, int n, const char *args[])
Instantiate a class template by substituting the provided arguments for the template parameters...
void vtkParse_ExpandValues(ValueInfo *valinfo, StringCache *cache, int n, const char *name[], const char *val[])
Wherever one of the specified names exists inside a Value or inside a Dimension size, replace it with the corresponding val string.
size_t vtkParse_NameLength(const char *text)
Skip over a name, including any namespace prefixes and any template arguments.
const char * vtkParse_ValueInfoToString(ValueInfo *val, int *nf)
Generate a declaration string from a ValueInfo struct.
void vtkParse_IntantiateFunctionTemplate(FunctionInfo *data, int n, const char *args[])
Instantiate a function or class method template by substituting the provided arguments for the templa...
size_t vtkParse_BasicTypeFromString(const char *text, unsigned int *type, const char **classname, size_t *classname_len)
Get a type from a type name, and return the number of characters used.
const char * vtkParse_StringReplace(const char *str1, int n, const char *name[], const char *val[])
Search and replace, return the initial string if no replacements occurred, else return a new string a...
void vtkParse_ExpandTypedef(ValueInfo *valinfo, ValueInfo *typedefinfo)
Expand a typedef within a variable, parameter, or typedef declaration.
const char ** vtkParse_GetArrayTypes()
Get a zero-terminated array of the types in vtkArray.
size_t vtkParse_ValueInfoFromString(ValueInfo *val, StringCache *cache, const char *text)
Generate a ValueInfo by parsing the type from the provided text.
ValueInfo is for typedefs, constants, variables, function parameters, and return values.
Definition: vtkParseData.h:98
FunctionInfo is for functions and methods.
Definition: vtkParseData.h:120
size_t vtkParse_IdentifierLength(const char *text)
This file contains extra utilities for parsing and wrapping.
void vtkParse_FreeTemplateDecomposition(const char *classname, int n, const char **args)
Free the list of strings returned by ExtractTemplateArgs.
ClassInfo is for classes, structs, unions, and namespaces.
Definition: vtkParseData.h:184
StringCache provides a simple way of allocating strings centrally.
size_t vtkParse_LiteralLength(const char *text)
Skip over a literal, which may be a number, a char in single quotes, a string in double quotes...
size_t vtkParse_UnscopedNameLength(const char *text)
Skip over a name, including any template arguments, but stopping if a '::' is encoutered.
size_t vtkParse_DecomposeTemplatedType(const char *text, const char **classname, int n, const char ***args, const char *defaults[])
Extract the class name and template args from a templated class type ID.
const char ** vtkParse_GetTemplateMacroTypes()
Get a zero-terminated array of the types in vtkTemplateMacro.