Skip to content

Commit

Permalink
Fix ambiguous Load Functions, now LoadFile and LoadText
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesevans14 committed Aug 22, 2024
1 parent 9ec034a commit f7fe9c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions CrossPlatform/TextInputOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,12 @@ static void LoadArray(TextInput::Array &array,const string &text,platform::core:
std::string sub=text.substr(start_pos,end_pos+1-start_pos);
TextFileInput *e=::new(m) TextFileInput;
array.push_back(e);
e->Load(sub);
e->LoadText(sub);
pos=end_pos;
}
}

void TextFileInput::Load(const std::string &text)
void TextFileInput::LoadText(const std::string &text)
{
// if there are multiple elements we expect to see { and } at the start and end.
size_t open_pos=text.find("{");
Expand Down Expand Up @@ -193,7 +193,7 @@ void TextFileInput::Load(const std::string &text)
{
size_t end_brace_pos=(size_t)findMatchingBrace(text,(int)brace_pos);
std::string sub=text.substr(brace_pos,end_brace_pos+1-brace_pos);
subElements[name].Load(sub);
subElements[name].LoadText(sub);
pos=end_brace_pos;
}
else if(next_ret<text.length())
Expand All @@ -213,7 +213,7 @@ void TextFileInput::SetFileLoader(platform::core::FileLoader *f)
fileLoader=f;
}

void TextFileInput::Load(const char *filename_utf8)
void TextFileInput::LoadFile(const char *filename_utf8)
{
if(!filename_utf8)
return;
Expand Down Expand Up @@ -255,7 +255,7 @@ void TextFileInput::Load(const char *filename_utf8)
text+="\r\n";
}
}
Load(text);
LoadText(text);
good=true;
}

Expand Down
4 changes: 2 additions & 2 deletions CrossPlatform/TextInputOutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ namespace platform
TextFileInput(platform::core::MemoryInterface *m=NULL);
virtual ~TextFileInput();
void SetFileLoader(platform::core::FileLoader *f);
void Load(const char *filename);
void Load(const std::string &text);
void LoadFile(const char *filename);
void LoadText(const std::string &text);
bool Good();
//! Is the specified element in the list?
virtual bool Has(const char *name) const;
Expand Down

0 comments on commit f7fe9c3

Please sign in to comment.