-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstr.h
More file actions
35 lines (32 loc) · 754 Bytes
/
str.h
File metadata and controls
35 lines (32 loc) · 754 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
#ifndef STR_H
#define STR_H
class str {
char* _s;
int _l,_res;
void _copy(const char*);
str(int);
public:
static int len(const char*);
str();
str(char, int);
str(const char*);
str(const str&);
~str();
void _resize(int);
int size()const;
int cmp(const char*)const;
void clear();
bool empty()const;
str operator+(const str&)const;
str operator+(const char*)const;
str& operator+=(const str&);
str& operator+=(const char*);
str& operator=(const char*);
str& operator=(const str&);
char& operator[](int)const;
bool operator==(const str&)const;
bool operator==(const char*)const;
friend std::ostream& operator<<(std::ostream&, const str&);
friend std::istream& operator>>(std::istream&, str&);
};
#endif