Do bulk replace of stl types.

This commit is contained in:
jmsgrogan 2023-12-21 09:18:44 +00:00
parent 521486be62
commit c25a56ee19
531 changed files with 2274 additions and 2181 deletions

View file

@ -4,7 +4,7 @@
#include <locale>
#include <algorithm>
TomlTable::TomlTable(const std::string& header)
TomlTable::TomlTable(const String& header)
: mHeader(header)
{
@ -15,22 +15,22 @@ void TomlTable::addComment(const Comment& comment)
mComments.push_back(comment);
}
void TomlTable::addTable(std::unique_ptr<TomlTable> table)
void TomlTable::addTable(Ptr<TomlTable> table)
{
mTables[table->getHeader()] = std::move(table);
}
void TomlTable::addKeyValuePair(const std::string& key, const std::string& value)
void TomlTable::addKeyValuePair(const String& key, const String& value)
{
mMap[key] = value;
}
std::string TomlTable::getHeader() const
String TomlTable::getHeader() const
{
return mHeader;
}
TomlTable* TomlTable::getTable(const std::string& path)
TomlTable* TomlTable::getTable(const String& path)
{
return mTables[path].get();
}
@ -52,7 +52,7 @@ TomlTable* TomlContent::getRootTable() const
return mRootTable.get();
}
TomlTable* TomlContent::getTable(const std::string& path) const
TomlTable* TomlContent::getTable(const String& path) const
{
return mRootTable->getTable(path);
}
@ -83,13 +83,13 @@ void TomlReader::read(const Path& input_path)
mWorkingTable = nullptr;
}
void TomlReader::processLine(const std::string& line)
void TomlReader::processLine(const String& line)
{
bool in_comment{ false };
bool in_header{ false };
bool found_key{ false };
std::string working_string;
std::string key_string;
String working_string;
String key_string;
for (auto c : line)
{
if (c == '#' && !in_comment)
@ -137,7 +137,7 @@ void TomlReader::processLine(const std::string& line)
}
}
void TomlReader::onHeader(const std::string& header)
void TomlReader::onHeader(const String& header)
{
auto new_table = std::make_unique<TomlTable>(header);
auto table_temp = new_table.get();
@ -145,7 +145,7 @@ void TomlReader::onHeader(const std::string& header)
mWorkingTable = table_temp;
}
void TomlReader::onKeyValuePair(const std::string key, const std::string value)
void TomlReader::onKeyValuePair(const String key, const String value)
{
mWorkingTable->addKeyValuePair(key, value);
}