-
Notifications
You must be signed in to change notification settings - Fork 0
/
hex.h
52 lines (43 loc) · 1.01 KB
/
hex.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/****************************************************************
* Header file for the 'Hex' class to contain one hex operand.
*
* Author/copyright: Duncan A. Buell. All rights reserved.
* Used with permission and modified by: Austin Staton
* Date: 21 October 2018
**/
#ifndef HEX_H
#define HEX_H
#include <iostream>
#include <string>
using std::cin;
using std::cout;
using std::endl;
using std::string;
// #include "./Utilities/scanner.h"
// #include "./Utilities/scanline.h"
#include "./Utilities/utils.h"
#include "dabnamespace.h"
class Hex {
public:
Hex();
Hex(string hexoperand);
virtual ~Hex();
string GetErrorMessages() const;
int GetValue() const;
string GetText() const;
bool HasAnError() const;
bool IsNegative() const;
bool IsNotNull() const;
bool IsNull() const;
string ToString() const;
private:
bool is_invalid_;
bool is_negative_;
bool is_null_;
int value_;
string error_messages_;
string text_;
void Init(string hexoperand);
void ParseHexOperand();
};
#endif