-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstring.hpp
More file actions
60 lines (50 loc) · 1.53 KB
/
string.hpp
File metadata and controls
60 lines (50 loc) · 1.53 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef _CFC_PRIMITIVES
#define _CFC_PRIMITIVES
#include <string>
#include <iostream>
#include <istream>
#include <ostream>
#include <iomanip>
#include <cstring>
#include "object.hpp"
namespace CFC{
namespace Primitives {
class String: public Object, protected std::string{
friend std::ostream &operator<<(std::ostream &cout, const String &s);
friend std::istream &operator>>(std::istream &cin, String &s);
public:
String();
String(const String &s);
String(const std::string &s);
String(const char *s);
virtual ~String();
static long unsigned int Instances(){ return instances; }
size_t length();
size_t size();
operator std::string ();
operator std::string() const;
operator char();
operator char() const;
operator char*();
operator char*() const;
const String &operator=(const String &s);
const String &operator+(const String &s);
const String &operator+=(const String &s);
bool operator!() const;
bool operator==(const String &s) const;
bool operator!=(const String &s) const;
bool operator<(const String &s) const;
bool operator>(const String &s) const;
bool operator>=(const String &s) const;
bool operator<=(const String &s) const;
char &operator[](int i);
std::string &_get_data();
const std::string &_get_data() const;
protected:
private:
static long unsigned int instances;
std::string _data;
};
}
}
#endif