forked from LemonHaze420/DCPopulous
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstring.h
105 lines (83 loc) · 2.14 KB
/
string.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
93
94
95
96
97
98
99
100
101
102
103
104
105
#ifndef _CSTRING_H_
#define _CSTRING_H_
#include "Object.h"
#include <windows.h>
#include <string.h>
#include <stdio.h>
// ----
// Stores a string.
class CString : CObject
{
public:
CString();
CString(char* _String);
CString(CString* _String);
~CString();
// ----
// Release memory.
void Clear();
// ----
// Reads in the content of a file.
// Return value indicates number of bytes read. (I don't know how the file was opened [text/binary])
int LoadString(FILE* _FH, int _ReadLength = 0);
int LoadEncodedString(FILE* _FH, int _ReadLength = 0);
// ----
// Copies the string across exactly as is, without any
// fancy character conversion.
void AssignAsData(char* _String);
// ----
// Overload inherited method
TCHAR* ToString();
// ----
TCHAR* GetString();
// ----
UINT GetStringLength();
// ----
// Returns the size of the string in bytes.
UINT GetStringSize();
#ifdef INCLUDE_UNFINISHED_CODE
// ----
// Returns true if the string contains one, or more,
// new line characters.
bool DoesStringContainNewLine();
#endif
// ----
// Simply remove the last character from the string. (Bit of a quick fix)
void DeleteLastChar();
#ifdef INCLUDE_UNFINISHED_CODE
// ----
// Takes the first word from the object string and
// moves it into the _IntoHere object.
void MoveFirstWord(CString* _IntoHere, char _Delimiter = ' ');
// ----
// Copies the first word of the object string into the
// referenced object.
void CopyFirstWord(CString* _IntoHere, char _Delimiter = ' ');
// ----
// Removes the first word of the buffer, including
// trailing space.
void DeleteFirstWord(char _Delimiter = ' ');
#endif
#ifdef _UNICODE // Unicode only method
void operator= (WCHAR* _String);
#endif
void operator= (char* _String);
void operator= (CString* _String);
void operator= (CString& _String);
void operator+= (char* _String);
void operator+= (CString* _String);
void operator+= (CString& _String);
bool operator== (char* _StringRight);
bool operator== (CString* _StringRight);
protected:
#ifdef DYNAMIC_CSTRING
#ifdef _UNICODE
UNALIGNED TCHAR *Buffer;
#else
TCHAR *Buffer;
#endif
#else
TCHAR Buffer[2048];
#endif
};
#endif