HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CPP_TokenStream.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  * NAME: CPP_TokenStream.h ( FS Library, C++)
7  *
8  * COMMENTS: Reads a stream of tokens using CPP
9  */
10 
11 #ifndef __CPP_TokenStream__
12 #define __CPP_TokenStream__
13 
14 #include "FS_API.h"
15 #include <UT/UT_String.h>
16 #include <UT/UT_WorkBuffer.h>
17 #include <UT/UT_WorkArgs.h>
18 
19 class CPP_Manager;
20 class UT_IStream;
21 
23 {
24 public:
25  CPP_TokenStream(const char *filename, int pathvar=-1,
26  const char **cpp_options=0);
27  CPP_TokenStream(UT_IStream &is, const char *filename="<internal>",
28  const char **cpp_options=0);
29  virtual ~CPP_TokenStream();
30 
31  void addIncludePath(const char *path);
32  void addIncludePathRaw(const char *path);
33 
34  int getLineNumber();
35  const char *getFileName();
36 
37  // Set to true to preserve backslashes in the stream. Otherwise escaped
38  // backslashes and quotes ('\\' and '\"') get expanded automatically.
39  // The default is to expand automatically (false).
40  void setPreserveBackslashes(bool flag);
41 
42  int getToken(UT_String &token);
43  void ungetToken(const UT_String &token);
44 
45  virtual void cppError(const char *message) const;
46  virtual void cppWarning(const char *message) const;
47 
48 protected:
49  void init(int pathvar, const char **cpp_options);
50 
54  CPP_Manager *myCPP;
55  int myOptind;
57 };
58 
59 #endif
60 
GT_API const UT_StringHolder filename
GLsizei const GLchar *const * path
Definition: glcorearb.h:3340
UT_WorkBuffer myArgBuf
UT_WorkArgs myArgs
CPP_Manager * myCPP
GLuint GLsizei const GLchar * message
Definition: glcorearb.h:2542
png_infop png_uint_32 flag
Definition: png.h:2242
#define FS_API
Definition: FS_API.h:10