-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBinary.h
More file actions
62 lines (35 loc) · 1.11 KB
/
Binary.h
File metadata and controls
62 lines (35 loc) · 1.11 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//
// Created by Eldar on 06-Nov-18.
//
#include <string>
#include <functional>
using namespace std;
#ifndef EX01_BINARY_H
#define EX01_BINARY_H
class Binary {
private:
string number;
public:
// Constructor
Binary(const string number);
Binary() {};
// Operators for binary
Binary operator^(const Binary &number) const;
Binary operator&(const Binary &number) const;
Binary &operator&=(const Binary &number);
Binary operator|(const Binary &number) const;
Binary &operator+=(const Binary &number);
Binary bitwiseOperator(const Binary &num2, bool (*func)(bool, bool)) const;
Binary operator<<(const int &number) const;
Binary operator>>(const int &number) const;
// Functions for logical bitwise
static bool logical_xor(bool x, bool y);
static bool logical_or(bool x, bool y);
static bool logical_and(bool x, bool y);
// Get and set values
string getValue() const;
void setValue(const string string1);
// Deep copy
Binary deepClone();
};
#endif //EX01_BINARY_H