-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathErrorState.h
37 lines (32 loc) · 856 Bytes
/
ErrorState.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
***********************************
Student Name:<Badal Sarkar>
Student#: <137226189>
Student e-mail: [email protected]
Subject: OOP244
Section: <SAA>
Topic: Assignment MS 5
***********************************
*/
#ifndef error_ama_h
#define error_ama_h
#include<iostream>
namespace ama {
class ErrorState {
char * errorStateMsg;
bool dataIsValid(const char* message)const;
void init(const char* message);
public:
explicit ErrorState(const char* errorMessage = nullptr);
ErrorState(const ErrorState& other) = delete;
ErrorState& operator=(const ErrorState& other) = delete;
~ErrorState();
operator bool() const;
ErrorState& operator=(const char* pText);
void message(const char* pText);
const char* message() const;
};
}
//helper function
std::ostream& operator<<(std::ostream& os, const ama::ErrorState& src);
#endif