Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
wstring.h
Go to the documentation of this file.
1/*
2** Command & Conquer Generals Zero Hour(tm)
3** Copyright 2025 Electronic Arts Inc.
4**
5** This program is free software: you can redistribute it and/or modify
6** it under the terms of the GNU General Public License as published by
7** the Free Software Foundation, either version 3 of the License, or
8** (at your option) any later version.
9**
10** This program is distributed in the hope that it will be useful,
11** but WITHOUT ANY WARRANTY; without even the implied warranty of
12** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13** GNU General Public License for more details.
14**
15** You should have received a copy of the GNU General Public License
16** along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19/****************************************************************************\
20* C O N F I D E N T I A L --- W E S T W O O D S T U D I O S *
21******************************************************************************
22Project Name: Carpenter (The RedAlert ladder creator)
23File Name : main.cpp
24Author : Neal Kettler
25Start Date : June 1, 1997
26Last Update : June 17, 1997
27\****************************************************************************/
28
29#ifndef WSTRING_HEADER
30#define WSTRING_HEADER
31
32#include <stdio.h>
33#include <stdlib.h>
34#include "wstypes.h"
35
36class Wstring
37{
38 public:
41 Wstring(IN char *string);
43
44 void clear(void);
45
46 bit8 cat(IN char *string);
47 bit8 cat(uint32 size,IN char *string);
48 bit8 cat(IN Wstring &string);
49
50 void cellCopy(OUT char *dest, uint32 len);
51 char remove(sint32 pos, sint32 count);
53 void removeSpaces(void);
54 char *get(void) RO;
55 char get(uint32 index) RO;
57 bit8 insert(char c, uint32 pos);
58 bit8 insert(char *instring, uint32 pos);
60 bit8 replace(IN char *replaceThis,IN char *withThis);
61 char set(IN char *str);
62 char set(uint32 size,IN char *str);
63 bit8 set(char c, uint32 index);
64 char setFormatted(IN char *str, ...); // Added by Joe Howes
65 void setSize(sint32 bytes); // create an empty string
66 void toLower(void);
67 void toUpper(void);
69 bit8 truncate(char c); // trunc after char c
70 sint32 getToken(int offset,char *delim,Wstring &out) RO;
71 sint32 getLine(int offset, Wstring &out);
72 void strgrow(int length);
73
74 bit8 operator==(IN char *other) RO;
76 bit8 operator!=(IN char *other) RO;
78
79 Wstring &operator=(IN char *other);
81 Wstring &operator+=(IN char *other);
83 Wstring operator+(IN char *other);
85
86 bool operator<(IN Wstring &other) RO;
87
88 private:
89 char *str; // Pointer to allocated string.
90 int strsize; // allocated data length
91};
92
93#endif
char bit8
Definition wstypes.h:61
#define IN
Definition wstypes.h:57
#define OUT
Definition wstypes.h:58
unsigned long uint32
Definition bittype.h:46
signed long sint32
Definition bittype.h:51
uint32 length(void)
Definition wstring.cpp:350
bit8 set(char c, uint32 index)
char set(IN char *str)
uint32 length(void) RO
Wstring(IN char *string)
void strgrow(int length)
void cellCopy(OUT char *dest, uint32 len)
void clear(void)
char * get(void) RO
bit8 beautifyNumber()
bit8 operator==(IN Wstring &other) RO
bit8 operator==(IN char *other) RO
bit8 removeChar(char c)
char remove(sint32 pos, sint32 count)
bool operator<(IN Wstring &other) RO
bit8 insert(char *instring, uint32 pos)
void toLower(void)
bit8 cat(IN char *string)
bit8 cat(IN Wstring &string)
void toUpper(void)
Wstring(IN Wstring &other)
void setSize(sint32 bytes)
Wstring & operator+=(IN Wstring &other)
Wstring & operator+=(IN char *other)
void removeSpaces(void)
char setFormatted(IN char *str,...)
bit8 operator!=(IN Wstring &other) RO
Wstring & operator=(IN char *other)
Wstring operator+(IN char *other)
Wstring & operator=(IN Wstring &other)
bit8 truncate(uint32 len)
bit8 insert(char c, uint32 pos)
sint32 getLine(int offset, Wstring &out)
Wstring operator+(IN Wstring &other)
char get(uint32 index) RO
sint32 getToken(int offset, char *delim, Wstring &out) RO
bit8 truncate(char c)
bit8 cat(uint32 size, IN char *string)
char set(uint32 size, IN char *str)
bit8 operator!=(IN char *other) RO
bit8 replace(IN char *replaceThis, IN char *withThis)
#define RO
Definition wstypes.h:92