-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDSString.h
48 lines (40 loc) · 1.06 KB
/
DSString.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
//
// Created by Sammy Timmins on 8/31/20.
//
#ifndef S20_PA01_SENTIMENTANALYSIS_DSSTRING_H
#define S20_PA01_SENTIMENTANALYSIS_DSSTRING_H
#include <iostream>
#include <cstring>
using namespace std;
class DSString
{
public:
DSString();
DSString(const char *);
~DSString();
DSString(const DSString ©);
DSString& operator=(const DSString&);
DSString&operator=(const char*);
DSString operator+(const DSString&) const;
DSString operator+(const char*);
DSString& operator+(const char);
bool operator==(const char*);
bool operator==(const DSString&);
bool operator>(const DSString&);
bool operator<(const DSString&) const;
char& operator[](const int) const;
friend std::ostream& operator<<(std::ostream&, const DSString&);
void print();
int getLength() const;
int getCapacity();
char* getString();
DSString substr(int pos, int npos) const;
char* c_str();
int dsstoi();
float dsstof();
private:
char* data;
int length;
int capacity;
};
#endif //S20_PA01_SENTIMENTANALYSIS_DSSTRING_H