Rendering refactoring

This commit is contained in:
Antoine Pilote
2021-07-12 20:17:16 -04:00
parent c2ce3c9cb9
commit 38ceae6fa9
40 changed files with 504 additions and 632 deletions

40
Nuake/src/Core/String.cpp Normal file
View File

@@ -0,0 +1,40 @@
#include "String.h"
#include <iostream>
#include <sstream>
namespace Nuake {
bool String::BeginsWith(const std::string& string, const std::string& begin)
{
if (string.rfind(begin, 0) == 0)
return true;
return false;
}
bool String::EndsWith(const std::string& string, const std::string& end)
{
if (string.length() >= end.length())
return (0 == string.compare(string.length() - end.length(), end.length(), end));
else
return false;
}
std::vector<std::string> String::Split(const std::string& string, char delimiter)
{
std::vector<std::string> result;
std::stringstream ss(string);
std::string item;
while (getline(ss, item, delimiter))
{
result.push_back(item);
}
return result;
}
float String::ToFloat(const std::string& string)
{
return std::stof(string);
}
}