HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DS_Stream.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: DS library (C++)
7  *
8  * COMMENTS: Handle's stream IO for a Dialog Script
9  */
10 
11 #ifndef __DS_Stream_h__
12 #define __DS_Stream_h__
13 
14 #include "PRM_API.h"
15 #include <FS/CPP_TokenStream.h>
16 #include <UT/UT_ErrorManager.h>
17 #include <UT/UT_ValArray.h>
18 #include <UT/UT_String.h>
19 
20 #define OBRACE "{"
21 #define CBRACE "}"
22 
23 class CPP_Manager;
24 
26 public:
27  DS_Stream(const char *filename, int pathvar=-1);
28  DS_Stream(UT_IStream &is, const char *filename="<internal>",
29  bool fordisablewhen = false);
30  ~DS_Stream();
31 
32  //
33  // Paths are specified in standard Houdini form (i.e. "@/vop/include")
34  //
35  int getOpenBrace();
36  int parseBlock(UT_String &block, char delimiter = '\n',
37  bool quote_tokens = false);
38  int getToken(UT_String &token);
39 
40 //
41 // Error handling stuff
42 //
45  { return myErrorManager.getErrorMessages(str, s); }
46  void clearErrors()
48  myErrorManager.clearAndDestroyErrors(); }
50  { myErrorManager.stealErrors(src.myErrorManager); }
51 
52  void message(const char *m); // { UTaddWarning("DS", 0, m); }
53  void warning(const char *m); // { UTaddWarning("DS", 0, m); }
54  void error(const char *m); // { UTaddWarning("DS", 0, m); }
55 
56 private:
57  UT_ErrorManager myErrorManager;
58 };
59 
60 #endif
int getToken(UT_String &token)
GT_API const UT_StringHolder filename
void clearErrors()
Definition: DS_Stream.h:46
UT_ErrorSeverity
Definition: UT_Error.h:25
UT_API UT_ErrorManager * UTgetErrorManager()
int getErrorMessages(UT_String &str, UT_ErrorSeverity s=UT_ERROR_NONE)
Definition: DS_Stream.h:43
void stealErrors(DS_Stream &src)
Definition: DS_Stream.h:49
GLuint GLsizei const GLchar * message
Definition: glcorearb.h:2542
void clearAndDestroyErrors()
A global error manager scope.
#define PRM_API
Definition: PRM_API.h:10
GLenum src
Definition: glcorearb.h:1792