-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathString.h
More file actions
39 lines (35 loc) · 704 Bytes
/
String.h
File metadata and controls
39 lines (35 loc) · 704 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
#pragma once
#ifndef _STRING_C_
#define _STRING_C_
//#include <string.h>
#include <malloc.h>
#include <stdio.h>
class String
{
public:
String();
String(const String&);
String(char);
String(const char*);
int replaceAll(char, char);
String subString(int, int);
const char* getCstr();
bool isEmpty();
bool equals(const String&);
bool equals(const char*);
String& operator+(char);
String& operator+(char*);
String& operator+(String&);
bool operator==(const String&);
String operator=(char*);
~String();
protected:
void memmCpy(char*, int, const char*, int);
int strLen(const char*);
void alloc(size_t size);
void destroy();
private:
char* buff;
int length;
};
#endif // !_STRING_C_