-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathErrorMessage.h
More file actions
34 lines (30 loc) · 1.01 KB
/
ErrorMessage.h
File metadata and controls
34 lines (30 loc) · 1.01 KB
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
/*
ErrorMessage.h
Name: Yuansheng Lu
Student ID: 136654167
E-mail: ylu140@myseneca.ca
*/
#ifndef SICT_ERROR_MESSAGE_H__
#define SICT_ERROR_MESSAGE_H__
#include <iostream>
namespace sict {
class ErrorMessage {
char* message_;
public:
// Constructors
ErrorMessage();
ErrorMessage(const char* errorMessage);
ErrorMessage(const ErrorMessage& em) = delete;
// Public member functions and operator overloads
ErrorMessage& operator=(const ErrorMessage& em) = delete;
ErrorMessage& operator=(const char* errorMessage);
virtual ~ErrorMessage();
void clear(); // De-allocates the memory pointed by message_
bool isClear()const; // Check whether message_ is nullptr or not
void message(const char* value); // message_ setter
const char* message()const; // Return message_
};
// Helper operator <<
std::ostream& operator<<(std::ostream& ostr, const ErrorMessage& em);
}
#endif