libcosmos
Linux C++ System Programming Library
Loading...
Searching...
No Matches
RangeError.hxx
1
#pragma once
2
3
// cosmos
4
#include <cosmos/error/ApiError.hxx>
5
6
namespace
cosmos {
7
9
13
class
COSMOS_API
RangeError
:
14
public
ApiError
{
15
public
:
// functions
16
17
explicit
RangeError
(
const
std::string_view operation,
const
size_t
required_length = 0) :
18
ApiError
{operation},
19
m_required_length{required_length} {
20
21
}
22
23
auto
requiredLength()
const
{
24
return
m_required_length;
25
}
26
27
bool
requiredLengthKnown()
const
{
28
return
requiredLength() != 0;
29
}
30
31
protected
:
// data
32
33
const
size_t
m_required_length = 0;
34
};
35
36
}
// end ns
cosmos::ApiError
Specialized exception type used when system APIs fail.
Definition
ApiError.hxx:18
cosmos::RangeError
Specialized exception type for out of range errors reported by the OS.
Definition
RangeError.hxx:14
include
error
RangeError.hxx
Generated by
1.12.0