HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
VEX_Error.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: VEX_Error.h ( VEX Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __VEX_Error__
12 #define __VEX_Error__
13 
14 #include "VEX_API.h"
15 #include <UT/UT_StringArray.h>
16 #include <SYS/SYS_Types.h>
17 #include <stdarg.h>
18 
19 class VEX_ErrorList;
20 
21 // Pure virtual interface for accumulating error information
23 public:
24  virtual ~VEX_ErrorLog() {}
25 
26  void error(const char *fmt, ...)
28  void warning(const char *fmt, ...)
30 
31  void error(const char *fmt, va_list args);
32  void warning(const char *fmt, va_list args);
33 
34  void mergeFrom(const VEX_ErrorList &list);
35 
36 protected:
37  virtual void addError(const char *msg) = 0;
38  virtual void addWarning(const char *msg) = 0;
39 };
40 
41 // Print errors to the console
43 public:
45 
46 protected:
47  virtual void addError(const char *msg);
48  virtual void addWarning(const char *msg);
49 };
50 
51 // Accumulate errors into lists
53 public:
54  const UT_StringArray &errors() const { return myErrors; }
55  const UT_StringArray &warnings() const { return myWarnings; }
56 
57 protected:
58  virtual void addError(const char *msg);
59  virtual void addWarning(const char *msg);
60 
61 private:
62  UT_StringArray myErrors;
63  UT_StringArray myWarnings;
64 };
65 
66 // Accumulate errors into a single string
68 public:
69  const UT_String &errors() const { return myErrors; }
70  const UT_String &warnings() const { return myWarnings; }
71 
72  void clear();
73 
74 protected:
75  virtual void addError(const char *msg);
76  virtual void addWarning(const char *msg);
77 
78 private:
79  UT_String myErrors;
80  UT_String myWarnings;
81 };
82 
83 #endif
84 
virtual void addError(const char *msg)=0
const UT_String & warnings() const
Definition: VEX_Error.h:70
const UT_StringArray & warnings() const
Definition: VEX_Error.h:55
virtual void addWarning(const char *msg)=0
#define VEX_API
Definition: VEX_API.h:11
const UT_String & errors() const
Definition: VEX_Error.h:69
const UT_StringArray & errors() const
Definition: VEX_Error.h:54
#define SYS_PRINTF_CHECK_ATTRIBUTE(string_index, first_to_check)
Definition: SYS_Types.h:425
#define const
Definition: zconf.h:214
virtual ~VEX_ErrorLog()
Definition: VEX_Error.h:24