libebml_ng
status.h
Go to the documentation of this file.
1 #ifndef EBML_NG_LAZYLOAD_STATUS_H
2 #define EBML_NG_LAZYLOAD_STATUS_H
3 
4 #include <string>
5 #include "../../ebmlElement.h"
6 // #include "../base.h"
7 // #include "../seekdata.h"
8 // #include "../exceptions.h"
9 // #include "../ebmlDataElement.h"
10 
11 
12 namespace ebml {
13  template<typename T>
14  class status_t {
15  protected:
16  bool result;
17  union {
18  std::string reason;
19  };
20  T _data;
21 
22  public:
23  status_t(bool);
24  status_t(bool, const T&);
25  status_t(bool, T&&);
26 
27  // template<typename... Args>
28  // status_t(bool, Args...);
29 
30  status_t(bool, const std::string&);
31  status_t(bool, std::string&&);
32  status_t(bool, const char*);
33 
34  status_t(bool, const std::string&, const T&);
35  status_t(bool, const char*, const T&);
36  status_t(bool, std::string&&, T&&);
37  status_t(bool, const char*, T&&);
38 
39  // template<typename... Args>
40  // status_t(bool, const std::string&, Args...);
41 
42  // template<typename... Args>
43  // status_t(bool, std::string&&, Args...);
44 
45  status_t(const status_t&);
46  status_t(status_t&&);
47  ~status_t();
48 
49  status_t& operator=(const status_t&);
51 
52  operator bool() const;
53  operator const T&() const;
54  const T& data() const;
55  operator std::string() const;
56  void throw_exc(const ptr<const ebmlElement>&) const;
57  void throw_exc(ptr<const ebmlElement>&&) const;
58  };
59 }
60 
61 #endif
Definition: status.h:14
Definition: basictypes.h:40
A drop-in replacement for std::shared_ptr tailored for EBML objects.
Definition: ptrs.h:27
const T & data() const
void throw_exc(const ptr< const ebmlElement > &) const
std::string reason
Definition: status.h:18
T _data
Definition: status.h:20
status_t & operator=(const status_t &)
bool result
Definition: status.h:16