-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStreamClasses.h
More file actions
46 lines (38 loc) · 879 Bytes
/
StreamClasses.h
File metadata and controls
46 lines (38 loc) · 879 Bytes
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
#pragma once
#include <iostream>
class Stream
{
private:
char* array = nullptr;
int size;
int capacity;
public:
Stream();
Stream(int capacity);
Stream(const char* str);
Stream(const Stream& other);
Stream& operator=(const Stream& other);
~Stream();
void setData(const char* str);
char* readInput();
char* getArray();
char* getArray() const;
int sizeOfArray() const;
int capacityOfArray();
void incrementSize();
void addElement(const char value);
void expandArray();
void printElements();
char operator[] (int index) const;
};
class ConstStream : public Stream {
public:
ConstStream(const char* str = "\0") : Stream(str) {}
void setData(const char* str) = delete;
void readInput() = delete;
};
class FileStream : public Stream
{
public:
FileStream(const char* filename);
};