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() override;
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); }
53  { return myErrorManager.getSeverity(); }
54 
55  void message(const char *m); // { UTaddWarning("DS", 0, m); }
56  void warning(const char *m); // { UTaddWarning("DS", 0, m); }
57  void error(const char *m); // { UTaddWarning("DS", 0, m); }
58 
59 private:
60  UT_ErrorManager myErrorManager;
61 };
62 
63 #endif
GLuint GLsizei const GLchar * message
Definition: glcorearb.h:2543
int getToken(UT_String &token)
GT_API const UT_StringHolder filename
void clearErrors()
Definition: DS_Stream.h:46
GLdouble s
Definition: glad.h:3009
UT_ErrorSeverity
Definition: UT_Error.h:25
UT_API UT_ErrorManager * UTgetErrorManager()
< returns > If no error
Definition: snippets.dox:2
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
void clearAndDestroyErrors()
A global error manager scope.
UT_ErrorSeverity getErrorSeverity()
Definition: DS_Stream.h:52
#define PRM_API
Definition: PRM_API.h:10
GLenum src
Definition: glcorearb.h:1793