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 {
27 public:
28  DS_Stream(const char *filename, int pathvar=-1);
29  DS_Stream(UT_IStream &is, const char *filename="<internal>",
30  bool fordisablewhen = false);
31  ~DS_Stream() override;
32 
33  //
34  // Paths are specified in standard Houdini form (i.e. "@/vop/include")
35  //
36  int getOpenBrace();
37  int parseBlock(UT_String &block, char delimiter = '\n',
38  bool quote_tokens = false);
39  int getToken(UT_String &token);
40 
41 //
42 // Error handling stuff
43 //
46  { return myErrorManager.getErrorMessages(str, s); }
47  void clearErrors()
49  myErrorManager.clearAndDestroyErrors(); }
51  { myErrorManager.stealErrors(src.myErrorManager); }
54  { return myErrorManager.getSeverity(); }
55 
56  void message(const char *m); // { UTaddWarning("DS", 0, m); }
57  void warning(const char *m); // { UTaddWarning("DS", 0, m); }
58  void error(const char *m); // { UTaddWarning("DS", 0, m); }
59 
60 private:
61  UT_ErrorManager myErrorManager;
62 };
63 
64 #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:47
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:44
void stealErrors(DS_Stream &src)
Definition: DS_Stream.h:50
void clearAndDestroyErrors()
A global error manager scope.
UT_ErrorSeverity getErrorSeverity()
Definition: DS_Stream.h:53
#define PRM_API
Definition: PRM_API.h:10
GLenum src
Definition: glcorearb.h:1793