BDS Public
Beam-lib  2.16.3
This is the Beam C++ class library.
BError.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * BError.h BError Class
3  * T.Barnaby, BEAM Ltd, 21/3/00
4  * Copyright (c) 2012 All Right Reserved, Beam Ltd, http://www.beam.ltd.uk
5  *******************************************************************************
6  */
7 #ifndef BERROR_H
8 #define BERROR_H 1
9 
10 #include <BString.h>
11 
12 enum BErrorNum {
20 
25 class BError {
26 public:
27  BError(int errNo = ErrorOk, BString errStr = "");
28  BError(BString errStr);
29 
30  BError copy();
31 
32  BError& set(int errNo, BString errStr = "");
33  BError& clear();
34  BError& setError(BString errStr = "");
35 
36 
37  BString getString() const;
38  int getNumber() const;
39 
40  int num() const;
41  const char* str() const;
42 
43  // Old functions
44  int getErrorNo() const;
45 
46  operator int() const;
47 private:
48  int oerrNo;
49  BString oerrStr;
50 
51 };
52 
53 inline BError::operator int () const {
54  return oerrNo;
55 }
56 
57 #endif
int getErrorNo() const
Get The error number.
Definition: BError.cpp:54
BError & set(int errNo, BString errStr="")
Set error number and message.
Definition: BError.cpp:22
Definition: BError.h:18
Definition: BError.h:13
Definition: BError.h:15
Definition: BError.h:17
Definition: BError.h:16
Definition: BString.h:18
Definition: BError.h:19
Definition: BError.h:15
Definition: BError.h:17
int num() const
Get The error number.
Definition: BError.cpp:46
const char * str() const
Return a char* string.
Definition: BError.cpp:50
Definition: BError.h:16
Definition: BError.h:13
Definition: BError.h:13
Definition: BError.h:16
Definition: BError.h:14
Definition: BError.h:17
Definition: BError.h:17
BError(int errNo=ErrorOk, BString errStr="")
Create object.
Definition: BError.cpp:8
int getNumber() const
Get The error number.
Definition: BError.cpp:42
Definition: BError.h:14
BError & setError(BString errStr="")
Set error type ERROR with optional message.
Definition: BError.cpp:33
Definition: BError.h:15
Definition: BError.h:16
BString getString() const
Get error message.
Definition: BError.cpp:38
BError copy()
Return an independant copy.
Definition: BError.cpp:18
Definition: BError.h:25
Definition: BError.h:14
Definition: BError.h:14
Definition: BError.h:16
Definition: BError.h:14
Definition: BError.h:15
Definition: BError.h:13
Definition: BError.h:19
BError & clear()
Clear the error.
Definition: BError.cpp:28
BErrorNum
Definition: BError.h:12
Definition: BError.h:13