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_NonCopyable.h>
16 #include <UT/UT_String.h>
17 #include <UT/UT_WorkArgs.h>
18 #include <UT/UT_WorkBuffer.h>
19 
20 class CPP_Manager;
21 class UT_IStream;
22 
24 {
25 public:
26  CPP_TokenStream(const char *filename, int pathvar=-1,
27  const char **cpp_options=0);
28  CPP_TokenStream(UT_IStream &is, const char *filename="<internal>",
29  const char **cpp_options=0);
30  virtual ~CPP_TokenStream();
31 
33 
34  void addIncludePath(const char *path);
35  void addIncludePathRaw(const char *path);
36 
37  /// Set additional CPP options
38  void setCPPOptions(const char **cpp_options);
39 
40  int getLineNumber();
41  const char *getFileName();
42 
43  // Set to true to preserve backslashes in the stream. Otherwise escaped
44  // backslashes and quotes ('\\' and '\"') get expanded automatically.
45  // The default is to expand automatically (false).
46  void setPreserveBackslashes(bool flag);
47 
48  int getToken(UT_String &token);
49  void ungetToken(const UT_String &token);
50 
51  virtual void cppError(const char *message) const;
52  virtual void cppWarning(const char *message) const;
53 
54 protected:
55  void init(int pathvar, const char **cpp_options);
56 
60  CPP_Manager *myCPP;
61  int myOptind;
63 };
64 
65 #endif
66 
GLuint GLsizei const GLchar * message
Definition: glcorearb.h:2543
GT_API const UT_StringHolder filename
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
UT_WorkBuffer myArgBuf
UT_WorkArgs myArgs
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
CPP_Manager * myCPP
#define FS_API
Definition: FS_API.h:10