cpp

Coverage Report

Created: 2022-09-21 22:22

/home/andy/git/oilshell/oil/mycpp/myerror.h
Line
Count
Source (jump to first uncovered line)
1
// myerror.h
2
//
3
// This header defines OSError with an 'errno' field, which Python requires.
4
// So it must be #included FIRST, before anything that defines the 'errno'
5
// macro is #included!
6
7
#ifndef MYERROR_H
8
#define MYERROR_H
9
10
// Base class that mycpp generates.
11
class _OSError {
12
 public:
13
0
  explicit _OSError(int err_num) : errno(err_num) {
14
0
  }
15
  int errno;
16
};
17
18
class IOError : public _OSError {
19
 public:
20
0
  explicit IOError(int err_num) : _OSError(err_num) {
21
0
  }
22
};
23
24
class OSError : public _OSError {
25
 public:
26
0
  explicit OSError(int err_num) : _OSError(err_num) {
27
0
  }
28
};
29
30
#endif  // MYERROR_H