You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
686 B
39 lines
686 B
2 years ago
|
//
|
||
|
// Created by lenfrex on 2022/4/4.
|
||
|
//
|
||
|
|
||
|
#ifndef WORK20220401_CSTRING_H
|
||
|
#define WORK20220401_CSTRING_H
|
||
|
|
||
|
#include "utility"
|
||
|
|
||
|
using namespace std::rel_ops;
|
||
|
class CString {
|
||
|
private:
|
||
|
char *data = nullptr;
|
||
|
int length = 0;
|
||
|
public:
|
||
|
explicit CString(int length);
|
||
|
|
||
|
CString(char *data, int length);
|
||
|
|
||
|
explicit CString(char *source);
|
||
|
|
||
|
CString(const CString &source);
|
||
|
|
||
|
CString();
|
||
|
|
||
|
~CString();
|
||
|
|
||
|
bool operator==(const CString &source) const;
|
||
|
|
||
|
bool operator<(const CString &source) const;
|
||
|
|
||
|
CString &operator+=(const CString &source);
|
||
|
|
||
|
CString &operator=(const CString &source);
|
||
|
};
|
||
|
|
||
|
|
||
|
#endif //WORK20220401_CSTRING_H
|