-
Notifications
You must be signed in to change notification settings - Fork 1
/
AnsiString.h
92 lines (69 loc) · 2.04 KB
/
AnsiString.h
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// 100% PURE ANSI C++ String Class
// (c) 2005 RadGs Software
// Author : Suica Eduard
#ifndef __ANSISTRING_H
#define __ANSISTRING_H
#include <stdio.h>
//#define USE_DEPRECATED
#define MAX_DECIMALS 0xFF
#define BLOCK_SIZE 16 //16
#define SERIALIZE_8BIT_LENGTH 1
#define SERIALIZE_16BIT_LENGTH 2
#define SERIALIZE_32BIT_LENGTH 4
class AnsiString {
private:
char *Data;
long _DATA_SIZE;
long _LENGTH;
public:
AnsiString(void);
AnsiString(const char *value);
//AnsiString(char *value);
AnsiString(char c);
AnsiString(int i);
AnsiString(long i);
AnsiString(double d);
AnsiString(const AnsiString& S);
char operator[](unsigned long index);
char operator[](int index);
int operator==(char *str);
int operator!=(char *str);
int operator==(AnsiString& S);
int operator!=(AnsiString& S);
int operator <(char *str);
int operator <=(char *str);
int operator >(char *str);
int operator >=(char *str);
int operator <(AnsiString& S);
int operator <=(AnsiString& S);
int operator >(AnsiString& S);
int operator >=(AnsiString& S);
void operator=(const char *value);
void operator=(char *value);
void operator=(const AnsiString& S);
void operator=(long i);
void operator=(int i);
void operator=(char c);
void operator=(double d);
void operator+=(char *value);
void operator+=(const char *value);
void operator+=(AnsiString& S);
void operator+=(char c);
operator char *();
AnsiString operator+(AnsiString& S);
AnsiString operator+(const char *value);
AnsiString operator+(char *value);
char *c_str();
long ToInt();
double ToFloat();
int LoadFile(char *filename);
int SaveFile(char *filename);
void LoadBuffer(const char *buffer, int size, int offset = 0);
long Length();
long Pos(AnsiString substr);
int Serialize(FILE *out, int type);
int Unserialize(FILE *out, int type);
void LinkBuffer(char *buffer, int size);
~AnsiString();
};
#endif