HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_ORMMigrationResult.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: UT_ORMMigrationResult.h
7  *
8  * COMMENTS:
9  *
10  *
11  */
12 
13 #ifndef __UT_ORMMIGRATIONRESULT_H__
14 #define __UT_ORMMIGRATIONRESULT_H__
15 
16 #include "UT_API.h"
17 
18 #include "UT_ErrorCode.h"
19 #include "UT_StringHolder.h"
20 #include "UT_StringArray.h"
21 
23 {
24 public:
25  bool success() const
26  {
27  return mySuccess;
28  }
29  explicit operator bool() const
30  {
31  return mySuccess;
32  }
33 
35  {
36  myLogs.emplace_back(log);
37  }
38  void setError(const UT_StringHolder& msg, UT_ErrorCode ec)
39  {
40  mySuccess = false;
41  myErrorMessage = msg;
42  myError = ec;
43  }
44  const UT_ErrorCode& error() const { return myError; }
45  const UT_StringHolder& message() const { return myErrorMessage; }
46 
47  const UT_StringArray& logs() const { return myLogs; }
48 
49 private:
50  bool mySuccess = true;
51  UT_StringHolder myErrorMessage;
52  UT_ErrorCode myError;
53  UT_StringArray myLogs;
54 };
55 
56 #endif // __UT_ORMMIGRATIONRESULT_H__
57 
const UT_StringArray & logs() const
#define UT_API
Definition: UT_API.h:14
void addActionLog(const UT_StringHolder &log)
std::error_code UT_ErrorCode
Definition: UT_ErrorCode.h:20
const UT_StringHolder & message() const
const UT_ErrorCode & error() const
OIIO_FORCEINLINE T log(const T &v)
Definition: simd.h:7688
void setError(const UT_StringHolder &msg, UT_ErrorCode ec)