WPILibC++
2020.3.2
Error.h
1
/*----------------------------------------------------------------------------*/
2
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
3
/* Open Source Software - may be modified and shared by FRC teams. The code */
4
/* must be accompanied by the FIRST BSD license file in the root directory of */
5
/* the project. */
6
/*----------------------------------------------------------------------------*/
7
8
#ifndef WPIUTIL_WPI_UV_ERROR_H_
9
#define WPIUTIL_WPI_UV_ERROR_H_
10
11
#include <uv.h>
12
13
namespace
wpi
{
14
namespace
uv {
15
19
class
Error
{
20
public
:
21
Error
() : m_err(UV_UNKNOWN) {}
22
explicit
Error
(
int
err) : m_err(err) {}
23
27
explicit
operator
bool()
const
{
return
m_err < 0; }
28
32
int
code
()
const
{
return
m_err; }
33
37
const
char
*
str
()
const
{
return
uv_strerror(m_err); }
38
42
const
char
*
name
()
const
{
return
uv_err_name(m_err); }
43
44
private
:
45
int
m_err;
46
};
47
48
}
// namespace uv
49
}
// namespace wpi
50
51
#endif // WPIUTIL_WPI_UV_ERROR_H_
wpi::uv::Error::name
const char * name() const
Returns the error name.
Definition:
Error.h:42
wpi
WPILib C++ utilities (wpiutil) namespace.
Definition:
EventLoopRunner.h:17
wpi::uv::Error::str
const char * str() const
Returns the error message.
Definition:
Error.h:37
wpi::uv::Error
Error code.
Definition:
Error.h:19
wpi::uv::Error::code
int code() const
Returns the error code.
Definition:
Error.h:32
wpiutil
src
main
native
include
wpi
uv
Error.h
Generated on Fri Feb 21 2020 08:50:37 for WPILibC++ by
1.8.16