mirror of
https://github.com/encounter/rb3.git
synced 2026-07-10 21:18:44 -07:00
add dolmatch output to repo
This commit is contained in:
+41490
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+13
-13
@@ -8,7 +8,7 @@ public:
|
||||
char *text;
|
||||
String();
|
||||
String(const char *);
|
||||
String(const char**); // fn_80361BC0
|
||||
String(const char **); // fn_80361BC0
|
||||
String(const String &);
|
||||
String(unsigned int, char); // fn_80361D1C
|
||||
|
||||
@@ -16,25 +16,25 @@ public:
|
||||
const char *GetText() const; // fn_8000DB9C
|
||||
void fn_80362260(unsigned int); // fn_80362260
|
||||
void Reserve(unsigned int); // fn_80361C90
|
||||
void fn_80361F04(const char*); // fn_80361F04
|
||||
void fn_80361F88(String*); // fn_80361F88
|
||||
void fn_80361F04(const char *); // fn_80361F04
|
||||
void fn_80361F88(String *); // fn_80361F88
|
||||
void fn_80361FC4(char); // fn_80361FC4
|
||||
void fn_803620B4(char**); // fn_803620B4
|
||||
void fn_803620B4(char **); // fn_803620B4
|
||||
|
||||
bool AreStringsDifferent(const char*); // fn_80362144
|
||||
bool AreStringsDifferent(const String*); // fn_80362188
|
||||
bool AreStringsIdentical(const char*); // fn_803621BC
|
||||
bool AreStringsIdentical(const String*); // fn_80362200
|
||||
int FindIndexOfSubstring(const char*, int); // fn_803622F8
|
||||
bool AreStringsDifferent(const char *); // fn_80362144
|
||||
bool AreStringsDifferent(const String *); // fn_80362188
|
||||
bool AreStringsIdentical(const char *); // fn_803621BC
|
||||
bool AreStringsIdentical(const String *); // fn_80362200
|
||||
int FindIndexOfSubstring(const char *, int); // fn_803622F8
|
||||
int FindLastIndexOfChar(char); // fn_803623A0
|
||||
int fn_803623E8(char*); // fn_803623E8
|
||||
bool SubstrExistsInString(char*); // fn_80362530
|
||||
int fn_803623E8(char *); // fn_803623E8
|
||||
bool SubstrExistsInString(char *); // fn_80362530
|
||||
void ReplaceCharsInString(char, char); // fn_80362778
|
||||
void SwapStrings(String*); // fn_803627A8
|
||||
void SwapStrings(String *); // fn_803627A8
|
||||
int FindFirstIndexOfCharAtOffset(char, int); // fn_803622A4
|
||||
void fn_80362730(); // fn_80362730
|
||||
|
||||
String* operator=(const char *);
|
||||
String *operator=(const char *);
|
||||
void ToLower();
|
||||
virtual ~String();
|
||||
virtual void fn_80361E34();
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
// fn_800A6E18
|
||||
// probably inline
|
||||
unsigned int String::GetTextLength(){
|
||||
return strlen(text);
|
||||
unsigned int String::GetTextLength()
|
||||
{
|
||||
return strlen(text);
|
||||
}
|
||||
+141
-118
@@ -18,10 +18,11 @@ String::String(const char *str)
|
||||
*this = str;
|
||||
}
|
||||
|
||||
String::String(const char** str){
|
||||
len = 0;
|
||||
String::String(const char **str)
|
||||
{
|
||||
len = 0;
|
||||
text = &lbl_808E4560;
|
||||
*this = *str;
|
||||
*this = *str;
|
||||
}
|
||||
|
||||
String::String(const String &str)
|
||||
@@ -31,15 +32,16 @@ String::String(const String &str)
|
||||
*this = str.GetText();
|
||||
}
|
||||
|
||||
String::String(unsigned int arg, char charg){
|
||||
len = 0;
|
||||
text = &lbl_808E4560;
|
||||
Reserve(arg);
|
||||
String::String(unsigned int arg, char charg)
|
||||
{
|
||||
len = 0;
|
||||
text = &lbl_808E4560;
|
||||
Reserve(arg);
|
||||
|
||||
for(int i = 0; i < arg; i++)
|
||||
text[i] = charg;
|
||||
for (int i = 0; i < arg; i++)
|
||||
text[i] = charg;
|
||||
|
||||
text[arg] = '\0';
|
||||
text[arg] = '\0';
|
||||
}
|
||||
|
||||
extern "C" void fn_80354878(int, int, char *);
|
||||
@@ -51,159 +53,179 @@ String::~String()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
String* String::operator=(const char* str){
|
||||
if(str == text){
|
||||
return this;
|
||||
}
|
||||
if(str == 0 || (*str == '\0')){
|
||||
fn_80362260(0);
|
||||
}
|
||||
else {
|
||||
Reserve(strlen(str));
|
||||
strcpy(text, str);
|
||||
}
|
||||
return this;
|
||||
String *String::operator=(const char *str)
|
||||
{
|
||||
if (str == text) {
|
||||
return this;
|
||||
}
|
||||
if (str == 0 || (*str == '\0')) {
|
||||
fn_80362260(0);
|
||||
} else {
|
||||
Reserve(strlen(str));
|
||||
strcpy(text, str);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
// returns false if strings are NOT different (matching)
|
||||
// returns true if strings ARE different (non matching)
|
||||
bool String::AreStringsDifferent(const char* str){
|
||||
if(str == nullptr) return true;
|
||||
else return strcmp(str, text);
|
||||
bool String::AreStringsDifferent(const char *str)
|
||||
{
|
||||
if (str == nullptr)
|
||||
return true;
|
||||
else
|
||||
return strcmp(str, text);
|
||||
}
|
||||
|
||||
bool String::AreStringsDifferent(const String* str){
|
||||
return strcmp(str->text, text);
|
||||
bool String::AreStringsDifferent(const String *str)
|
||||
{
|
||||
return strcmp(str->text, text);
|
||||
}
|
||||
|
||||
// returns true if strings are NOT different (matching)
|
||||
// returns false if strings ARE different (non matching)
|
||||
bool String::AreStringsIdentical(const char* str){
|
||||
if(str == nullptr) return false;
|
||||
else return strcmp(str, text) == 0;
|
||||
bool String::AreStringsIdentical(const char *str)
|
||||
{
|
||||
if (str == nullptr)
|
||||
return false;
|
||||
else
|
||||
return strcmp(str, text) == 0;
|
||||
}
|
||||
|
||||
bool String::AreStringsIdentical(const String* str){
|
||||
return strcmp(str->text, text) == 0;
|
||||
bool String::AreStringsIdentical(const String *str)
|
||||
{
|
||||
return strcmp(str->text, text) == 0;
|
||||
}
|
||||
|
||||
extern int fn_80354848(int, int);
|
||||
extern void fn_80354878(int, int, char*);
|
||||
extern void fn_80354878(int, int, char *);
|
||||
|
||||
// Redo this once you have fn_80354848 and fn_08354878 defined
|
||||
// rk wanted to call this MemmyUppies but i had to put a stop to it
|
||||
// -- dark
|
||||
void String::Reserve(unsigned int arg){
|
||||
void* dest;
|
||||
if(arg > len){
|
||||
dest = (void*)fn_80354848(arg + 1, 1);
|
||||
memcpy(dest, text, len + 1);
|
||||
*((char*)dest + arg) = 0;
|
||||
void String::Reserve(unsigned int arg)
|
||||
{
|
||||
void *dest;
|
||||
if (arg > len) {
|
||||
dest = (void *)fn_80354848(arg + 1, 1);
|
||||
memcpy(dest, text, len + 1);
|
||||
*((char *)dest + arg) = 0;
|
||||
|
||||
if(len != 0){
|
||||
fn_80354878(len + 1, 1, text);
|
||||
}
|
||||
if (len != 0) {
|
||||
fn_80354878(len + 1, 1, text);
|
||||
}
|
||||
|
||||
len = arg;
|
||||
text = (char*)dest;
|
||||
}
|
||||
len = arg;
|
||||
text = (char *)dest;
|
||||
}
|
||||
}
|
||||
|
||||
void String::fn_80361F88(String* str){
|
||||
const char* t = str->GetText();
|
||||
fn_80361F04(t);
|
||||
void String::fn_80361F88(String *str)
|
||||
{
|
||||
const char *t = str->GetText();
|
||||
fn_80361F04(t);
|
||||
}
|
||||
|
||||
void String::fn_80361FC4(char c){
|
||||
int iVar2 = GetTextLength();
|
||||
Reserve(iVar2 + 1);
|
||||
*(text + iVar2) = c;
|
||||
*(text + iVar2 + 1) = '\0';
|
||||
void String::fn_80361FC4(char c)
|
||||
{
|
||||
int iVar2 = GetTextLength();
|
||||
Reserve(iVar2 + 1);
|
||||
*(text + iVar2) = c;
|
||||
*(text + iVar2 + 1) = '\0';
|
||||
}
|
||||
|
||||
// assigns char** to this String's text field
|
||||
void String::fn_803620B4(char** str){
|
||||
this->operator=(*str);
|
||||
void String::fn_803620B4(char **str)
|
||||
{
|
||||
this->operator=(*str);
|
||||
}
|
||||
|
||||
// does strstr, and returns the index of where it begins
|
||||
int String::FindIndexOfSubstring(const char* str, int idx){
|
||||
char* found = strstr(text + idx, str);
|
||||
if(found != nullptr){
|
||||
return found - text;
|
||||
}
|
||||
return -1;
|
||||
int String::FindIndexOfSubstring(const char *str, int idx)
|
||||
{
|
||||
char *found = strstr(text + idx, str);
|
||||
if (found != nullptr) {
|
||||
return found - text;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int String::FindLastIndexOfChar(char charg){
|
||||
char* found = strrchr(text, charg);
|
||||
if(found != (char*)0){
|
||||
return found - text;
|
||||
}
|
||||
return -1;
|
||||
int String::FindLastIndexOfChar(char charg)
|
||||
{
|
||||
char *found = strrchr(text, charg);
|
||||
if (found != (char *)0) {
|
||||
return found - text;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
static const size_t npos = -1;
|
||||
|
||||
// not fully matched! fix this
|
||||
// also figure out exactly what this is supposed to do
|
||||
int String::fn_803623E8(char* str){
|
||||
int a;
|
||||
int lastIndex;
|
||||
if(str == nullptr) return -1;
|
||||
else {
|
||||
a = -1;
|
||||
while(*str != '\0'){
|
||||
lastIndex = FindLastIndexOfChar(*str);
|
||||
if((lastIndex != npos) && (lastIndex > a)){
|
||||
a = lastIndex;
|
||||
}
|
||||
str++;
|
||||
}
|
||||
lastIndex = -1;
|
||||
if(a != -1){
|
||||
lastIndex = a;
|
||||
}
|
||||
return lastIndex;
|
||||
}
|
||||
int String::fn_803623E8(char *str)
|
||||
{
|
||||
int a;
|
||||
int lastIndex;
|
||||
if (str == nullptr)
|
||||
return -1;
|
||||
else {
|
||||
a = -1;
|
||||
while (*str != '\0') {
|
||||
lastIndex = FindLastIndexOfChar(*str);
|
||||
if ((lastIndex != npos) && (lastIndex > a)) {
|
||||
a = lastIndex;
|
||||
}
|
||||
str++;
|
||||
}
|
||||
lastIndex = -1;
|
||||
if (a != -1) {
|
||||
lastIndex = a;
|
||||
}
|
||||
return lastIndex;
|
||||
}
|
||||
}
|
||||
|
||||
bool String::SubstrExistsInString(char* str){
|
||||
int index = FindIndexOfSubstring(str, 0) + 1;
|
||||
return (index != 0);
|
||||
bool String::SubstrExistsInString(char *str)
|
||||
{
|
||||
int index = FindIndexOfSubstring(str, 0) + 1;
|
||||
return (index != 0);
|
||||
}
|
||||
|
||||
void String::ReplaceCharsInString(char old_char, char new_char){
|
||||
char* p;
|
||||
for(p = text; *p != '\0'; p++){
|
||||
if(*p == old_char)
|
||||
*p = new_char;
|
||||
}
|
||||
void String::ReplaceCharsInString(char old_char, char new_char)
|
||||
{
|
||||
char *p;
|
||||
for (p = text; *p != '\0'; p++) {
|
||||
if (*p == old_char)
|
||||
*p = new_char;
|
||||
}
|
||||
}
|
||||
|
||||
void String::SwapStrings(String* s){
|
||||
char* temp_text;
|
||||
unsigned int temp_len;
|
||||
void String::SwapStrings(String *s)
|
||||
{
|
||||
char *temp_text;
|
||||
unsigned int temp_len;
|
||||
|
||||
temp_text = text;
|
||||
text = s->text;
|
||||
temp_len = len;
|
||||
len = s->len;
|
||||
s->text = temp_text;
|
||||
s->len = temp_len;
|
||||
temp_text = text;
|
||||
text = s->text;
|
||||
temp_len = len;
|
||||
len = s->len;
|
||||
s->text = temp_text;
|
||||
s->len = temp_len;
|
||||
}
|
||||
|
||||
// finds index of the first instance of char argument in string at an offset
|
||||
int String::FindFirstIndexOfCharAtOffset(char charg, int idx){
|
||||
char* p = text + idx;
|
||||
int String::FindFirstIndexOfCharAtOffset(char charg, int idx)
|
||||
{
|
||||
char *p = text + idx;
|
||||
|
||||
while((*p != '\0') && (*p != charg)) p++;
|
||||
|
||||
if(*p != '\0'){
|
||||
return p - text;
|
||||
}
|
||||
return -1;
|
||||
while ((*p != '\0') && (*p != charg))
|
||||
p++;
|
||||
|
||||
if (*p != '\0') {
|
||||
return p - text;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
extern char fn_80018764(char);
|
||||
@@ -223,9 +245,10 @@ void String::ToLower()
|
||||
extern char fn_80018734(char);
|
||||
|
||||
// rename this method once you figure out what fn_80018734 does
|
||||
void String::fn_80362730(){
|
||||
char* p;
|
||||
for(p = text; *p != '\0'; p++){
|
||||
*p = fn_80018734(*p);
|
||||
}
|
||||
void String::fn_80362730()
|
||||
{
|
||||
char *p;
|
||||
for (p = text; *p != '\0'; p++) {
|
||||
*p = fn_80018734(*p);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user