Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
string.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
20// //
21// (c) 2001-2003 Electronic Arts Inc. //
22// //
24
25//----------------------------------------------------------------------------
26//
27// Westwood Studios Pacific.
28//
29// Confidential Information
30// Copyright(C) 2001 - All Rights Reserved
31//
32//----------------------------------------------------------------------------
33//
34// Project: WSYS Library
35//
36// Module: String
37//
38// File name: wsys/string.h
39//
40// Created: 11/02/01
41//
42//----------------------------------------------------------------------------
43
44#pragma once
45
46#ifndef __WSYS_STRING_H
47#define __WSYS_STRING_H
48
49
50//----------------------------------------------------------------------------
51// Includes
52//----------------------------------------------------------------------------
53
54#include "Lib/BaseType.h"
55
56//----------------------------------------------------------------------------
57// Forward References
58//----------------------------------------------------------------------------
59
60
61
62//----------------------------------------------------------------------------
63// Type Defines
64//----------------------------------------------------------------------------
65
66
68{
69 protected:
70
72
73 public:
74
75 explicit WSYS_String(const Char *string = NULL);
77
78 // operators
79 Bool operator== (const char *rvalue) const;
80 Bool operator!= (const char *rvalue) const;
81 const WSYS_String& operator= (const WSYS_String &string);
82 const WSYS_String& operator= (const Char *string);
83 const WSYS_String& operator+= (const WSYS_String &string);
84 const WSYS_String& operator+= (const Char *string);
85 friend WSYS_String operator+ (const WSYS_String &string1, const WSYS_String &string2);
86 friend WSYS_String operator+ (const Char *string1, const WSYS_String &string2);
87 friend WSYS_String operator+ (const WSYS_String &string1, const Char *string2);
88 const Char & operator[] (Int index) const;
89 Char & operator[] (Int index);
90 operator const Char * (void) const;
91 operator Char * (void) const ;
92
93 // methods
94 void makeUpperCase( void );
95 void makeLowerCase( void );
96 Int length(void) const;
97 Bool isEmpty(void) const;
98 Int _cdecl format(const Char *format, ...);
99 void set( const Char *string );
100 Char* get( void ) const;
101};
102
103
104
105//----------------------------------------------------------------------------
106// Inlining
107//----------------------------------------------------------------------------
108
109inline Char* WSYS_String::get( void ) const { return m_data;};
110inline const Char& WSYS_String::operator[] (Int index) const{ return m_data[index];};
111inline Char& WSYS_String::operator[] (Int index) { return m_data[index];};
112inline WSYS_String::operator const Char * (void) const { return m_data;};
113inline WSYS_String::operator Char * (void) const {return m_data;};
114
115
116#endif // __WSYS_STRING_H
#define NULL
Definition BaseType.h:92
bool Bool
Definition BaseType.h:132
char Char
Signed character (ASCII)
Definition BaseType.h:131
Bool operator!=(const char *rvalue) const
Definition String.cpp:138
WSYS_String(const Char *string=NULL)
Definition String.cpp:110
friend WSYS_String operator+(const WSYS_String &string1, const WSYS_String &string2)
Definition String.cpp:208
Char * m_data
actual string data
Definition string.h:71
void makeLowerCase(void)
Definition String.cpp:319
const WSYS_String & operator=(const WSYS_String &string)
Definition String.cpp:147
Int length(void) const
Definition String.cpp:242
Bool operator==(const char *rvalue) const
Definition String.cpp:129
void makeUpperCase(void)
Definition String.cpp:304
Char * get(void) const
Definition string.h:109
void set(const Char *string)
Definition String.cpp:286
const WSYS_String & operator+=(const WSYS_String &string)
Definition String.cpp:167
Int _cdecl format(const Char *format,...)
Definition String.cpp:260
Bool isEmpty(void) const
Definition String.cpp:251
const Char & operator[](Int index) const
Definition string.h:110