Zivid  1.0.1+3607.8a7510c4
Zivid API
Exception.h
Go to the documentation of this file.
1 /*[
2  * This file is part of the Zivid 3D Camera API
3  *
4  * Copyright 2015-2018 (C) Zivid Labs. All rights reserved.
5  * Contact info@zividlabs.com or see http://www.zividlabs.com
6  *
7  * This code is proprietary and confidential.
8  * Unauthorized copying of this file, via any medium is strictly prohibited.
9 ]*/
10 
11 #pragma once
12 
15 
16 #include "APIExport.h"
17 #include <string>
18 #include <exception>
19 
20 namespace Zivid
21 {
25  class Exception : public std::exception
26  {
27  protected:
29  ZIVID_COMMON explicit Exception(const std::string &message);
30 
31  public:
33  ZIVID_COMMON const char* what() const noexcept override;
34 
35  private:
36  std::string m_message;
37  };
38 
43  {
44  protected:
46  ZIVID_COMMON explicit ArgumentException(const std::string &message);
47  };
48 
52  class IOException : public Exception
53  {
54  public:
56  ZIVID_COMMON explicit IOException(const std::string &message);
57  };
58 
62  class LogicException : public Exception
63  {
64  public:
66  ZIVID_COMMON explicit LogicException(const std::string &message);
67  };
68 
72  class RuntimeException : public Exception
73  {
74  public:
76  ZIVID_COMMON explicit RuntimeException(const std::string &message);
77  };
78 
81  ZIVID_COMMON std::string toString(const std::exception &exception);
82 }
83 
84 #ifdef __has_include
85  #if __has_include("InternalExceptions.h")
86  #ifndef _M_CEE
87  #include "InternalExceptions.h"
88  #endif
89  #else
90  namespace Zivid {
91  class SettingsInternal;
92  }
93  #endif
94 #endif
An exception that is thrown when an unpredictable event caused an operation to fail.
Definition: Exception.h:72
An exception that is thrown when an argument provided to a method is invalid.
Definition: Exception.h:42
ZIVID_COMMON const char * what() const noexcept override
Get the message for the exception
A common base class for all Zivid exceptions.
Definition: Exception.h:25
Definition: Application.h:19
Definitions for export of DLL interfaces
ZIVID_COMMON Exception(const std::string &message)
Constructor
An exception that is thrown when attempting to do an operation that doesn&#39;t make sense in the current...
Definition: Exception.h:62
ZIVID_COMMON std::string toString(const std::exception &exception)
Get string representation of the exception
An exception that is thrown whenever an I/O error occurs.
Definition: Exception.h:52