Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
ustring.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#ifndef USTRING_HEADER
20#define USTRING_HEADER
21
22#include <stdlib.h>
23#include <stdio.h>
24#include <iostream.h>
25#include <string>
26
27// Windows headers have a tendency to redefine IN
28#ifdef IN
29#undef IN
30#endif
31#define IN const
32
33#define MAX_BYTES_PER_CHAR 1
34
35template <class charT>
36class UstringT : public basic_string<charT, string_char_traits<charT> >
37{
38 public:
39 explicit UstringT(int max_charlength) {
41 }
42
43 UstringT() { max_bytelength=4000; }
44
45 size_t get_max_bytelength(void) { return(max_bytelength); }
46 void set_max_bytelength(size_t max) { max_bytelength=max; }
47
48 bool operator==(const UstringT<charT> &other)
49 {
50 const basic_string<charT, string_char_traits<charT> > *other_basic=&other;
51 const basic_string<charT, string_char_traits<charT> > *this_basic=this;
52 return((*other_basic)==(*this_basic));
53 }
54
55 private:
56 size_t max_bytelength;
57};
58
60
61#endif
#define max(x, y)
Definition BaseType.h:105
void set_max_bytelength(size_t max)
Definition ustring.h:46
size_t get_max_bytelength(void)
Definition ustring.h:45
bool operator==(const UstringT< charT > &other)
Definition ustring.h:48
UstringT(int max_charlength)
Definition ustring.h:39
UstringT()
Definition ustring.h:43
UstringT< char > Ustring
Definition ustring.h:59
#define MAX_BYTES_PER_CHAR
Definition ustring.h:33