exceptions.hpp
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // boost/format/exceptions.hpp
3 // ----------------------------------------------------------------------------
4 
5 // Copyright Samuel Krempp 2003.
6 //
7 // Distributed under the Boost Software License, Version 1.0.
8 // (See accompanying file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt)
10 //
11 //
12 // See http://www.boost.org/libs/format/ for library home page
13 
14 // ----------------------------------------------------------------------------
15 
16 #ifndef BOOST_FORMAT_EXCEPTIONS_HPP
17 #define BOOST_FORMAT_EXCEPTIONS_HPP
18 
19 
20 #include <stdexcept>
21 
22 
23 namespace boost {
24 
25  namespace io {
26 
27 // **** exceptions -----------------------------------------------
28 
29  class format_error : public std::exception
30  {
31  public:
33  virtual const char *what() const throw() {
34  return "boost::format_error: "
35  "format generic failure";
36  }
37  };
38 
40  {
41  std::size_t pos_, next_;
42  public:
43  bad_format_string(std::size_t pos, std::size_t size)
44  : pos_(pos), next_(size) {}
45  std::size_t get_pos() const { return pos_; }
46  std::size_t get_next() const { return next_; }
47  virtual const char *what() const throw() {
48  return "boost::bad_format_string: format-string is ill-formed";
49  }
50  };
51 
52  class too_few_args : public format_error
53  {
54  std::size_t cur_, expected_;
55  public:
56  too_few_args(std::size_t cur, std::size_t expected)
57  : cur_(cur), expected_(expected) {}
58  std::size_t get_cur() const { return cur_; }
59  std::size_t get_expected() const { return expected_; }
60  virtual const char *what() const throw() {
61  return "boost::too_few_args: "
62  "format-string referred to more arguments than were passed";
63  }
64  };
65 
66  class too_many_args : public format_error
67  {
68  std::size_t cur_, expected_;
69  public:
70  too_many_args(std::size_t cur, std::size_t expected)
71  : cur_(cur), expected_(expected) {}
72  std::size_t get_cur() const { return cur_; }
73  std::size_t get_expected() const { return expected_; }
74  virtual const char *what() const throw() {
75  return "boost::too_many_args: "
76  "format-string referred to less arguments than were passed";
77  }
78  };
79 
80 
81  class out_of_range : public format_error
82  {
83  int index_, beg_, end_; // range is [ beg, end [
84  public:
85  out_of_range(int index, int beg, int end)
86  : index_(index), beg_(beg), end_(end) {}
87  int get_index() const { return index_; }
88  int get_beg() const { return beg_; }
89  int get_end() const { return end_; }
90  virtual const char *what() const throw() {
91  return "boost::out_of_range: "
92  "tried to refer to an argument (or item) number which"
93  " is out of range, according to the format string";
94  }
95  };
96 
97 
98  } // namespace io
99 
100 } // namespace boost
101 
102 
103 #endif // BOOST_FORMAT_EXCEPTIONS_HPP
GLuint GLuint end
BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE.
virtual const char * what() const
Definition: exceptions.hpp:90
std::size_t get_expected() const
Definition: exceptions.hpp:59
GLuint index
virtual const char * what() const
Definition: exceptions.hpp:47
GLsizeiptr size
std::size_t get_cur() const
Definition: exceptions.hpp:58
std::size_t get_pos() const
Definition: exceptions.hpp:45
std::size_t get_expected() const
Definition: exceptions.hpp:73
too_many_args(std::size_t cur, std::size_t expected)
Definition: exceptions.hpp:70
std::size_t get_cur() const
Definition: exceptions.hpp:72
bad_format_string(std::size_t pos, std::size_t size)
Definition: exceptions.hpp:43
virtual const char * what() const
Definition: exceptions.hpp:33
out_of_range(int index, int beg, int end)
Definition: exceptions.hpp:85
std::size_t get_next() const
Definition: exceptions.hpp:46
virtual const char * what() const
Definition: exceptions.hpp:74
float rs2_vector::* pos
int get_index() const
Definition: exceptions.hpp:87
too_few_args(std::size_t cur, std::size_t expected)
Definition: exceptions.hpp:56
virtual const char * what() const
Definition: exceptions.hpp:60


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:14