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.
40 lines
864 B
40 lines
864 B
//
|
|
// Created by lenfrex on 2022/4/4.
|
|
//
|
|
|
|
#ifndef WORK20220401_CSTRING_H
|
|
#define WORK20220401_CSTRING_H
|
|
|
|
#include <iostream>
|
|
#include "utility"
|
|
|
|
using namespace std::rel_ops;
|
|
class CString {
|
|
private:
|
|
char *data = nullptr;
|
|
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);
|
|
|
|
friend std::ostream &operator<<(std::ostream &outputStream, const CString &source);
|
|
friend std::istream &operator>>(std::istream &outputStream, const CString &source);
|
|
};
|
|
|
|
#endif //WORK20220401_CSTRING_H
|
|
|