Code styling pass

This commit is contained in:
Antoine Pilote
2023-07-10 13:26:43 -04:00
parent bf51b3be00
commit 1e2c379462
7 changed files with 25 additions and 14 deletions

View File

@@ -1,10 +1,11 @@
#pragma once
#include "Core.h"
#include "String.h"
#include <string>
#include <filesystem>
#include "Core.h"
#include <iostream>
#include <fstream>
#include "String.h"
namespace Nuake
{

View File

@@ -1,5 +1,5 @@
#include "Input.h"
#include "../Window.h"
#include "src/Window.h"
#include <Imgui/imgui_impl_glfw.h>
#include <GLFW/glfw3.h>

View File

@@ -1,7 +1,8 @@
#pragma once
#include <utility>
#include "../Core/Maths.h"
#include "src/Core/Maths.h"
#include <map>
#include <utility>
struct GLFWwindow;

View File

@@ -1,4 +1,5 @@
#include "Logger.h"
#include <iostream>
#include <chrono>
#include <string>
@@ -6,7 +7,7 @@
namespace Nuake
{
std::vector<LogEntry> Logger::m_Logs = std::vector<LogEntry>();
std::vector<LogEntry> Logger::m_Logs = std::vector<LogEntry>();
void Logger::Log(const std::string& log, LOG_TYPE type)
{

View File

@@ -20,11 +20,12 @@ namespace Nuake
class Logger
{
public:
static void Log(const std::string& log, LOG_TYPE type = VERBOSE);
static std::vector<LogEntry> GetLogs();
private:
static const int MAX_LOG = 64;
static std::vector<LogEntry> m_Logs;
public:
static void Log(const std::string& log, LOG_TYPE type = VERBOSE);
static std::vector<LogEntry> GetLogs();
};
}

View File

@@ -2,11 +2,14 @@
#include <iostream>
#include <sstream>
namespace Nuake {
namespace Nuake
{
bool String::BeginsWith(const std::string& string, const std::string& begin)
{
if (string.rfind(begin, 0) == 0)
{
return true;
}
return false;
}
@@ -14,9 +17,11 @@ namespace Nuake {
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;
}
return false;
}
std::vector<std::string> String::Split(const std::string& string, char delimiter)

View File

@@ -6,8 +6,10 @@
This class purpose is to provide helper methods related to strings.
It is not meant to be a replacement for std::string.
*/
namespace Nuake {
class String {
namespace Nuake
{
class String
{
public:
static bool BeginsWith(const std::string& string, const std::string& begin);
static bool EndsWith(const std::string& string, const std::string& end);