From 1e2c379462eb32ba427cd33574c580c57e4fc61e Mon Sep 17 00:00:00 2001 From: Antoine Pilote Date: Mon, 10 Jul 2023 13:26:43 -0400 Subject: [PATCH] Code styling pass --- Nuake/src/Core/FileSystem.h | 5 +++-- Nuake/src/Core/Input.cpp | 2 +- Nuake/src/Core/Input.h | 5 +++-- Nuake/src/Core/Logger.cpp | 3 ++- Nuake/src/Core/Logger.h | 7 ++++--- Nuake/src/Core/String.cpp | 11 ++++++++--- Nuake/src/Core/String.h | 6 ++++-- 7 files changed, 25 insertions(+), 14 deletions(-) diff --git a/Nuake/src/Core/FileSystem.h b/Nuake/src/Core/FileSystem.h index f0f8ecf1..ded779d6 100644 --- a/Nuake/src/Core/FileSystem.h +++ b/Nuake/src/Core/FileSystem.h @@ -1,10 +1,11 @@ #pragma once +#include "Core.h" +#include "String.h" + #include #include -#include "Core.h" #include #include -#include "String.h" namespace Nuake { diff --git a/Nuake/src/Core/Input.cpp b/Nuake/src/Core/Input.cpp index b59d35fd..b5cd1db5 100644 --- a/Nuake/src/Core/Input.cpp +++ b/Nuake/src/Core/Input.cpp @@ -1,5 +1,5 @@ #include "Input.h" -#include "../Window.h" +#include "src/Window.h" #include #include diff --git a/Nuake/src/Core/Input.h b/Nuake/src/Core/Input.h index ffbfc5cf..f925b574 100644 --- a/Nuake/src/Core/Input.h +++ b/Nuake/src/Core/Input.h @@ -1,7 +1,8 @@ #pragma once -#include -#include "../Core/Maths.h" +#include "src/Core/Maths.h" + #include +#include struct GLFWwindow; diff --git a/Nuake/src/Core/Logger.cpp b/Nuake/src/Core/Logger.cpp index ec5ba39c..7af7089c 100644 --- a/Nuake/src/Core/Logger.cpp +++ b/Nuake/src/Core/Logger.cpp @@ -1,4 +1,5 @@ #include "Logger.h" + #include #include #include @@ -6,7 +7,7 @@ namespace Nuake { - std::vector Logger::m_Logs = std::vector(); + std::vector Logger::m_Logs = std::vector(); void Logger::Log(const std::string& log, LOG_TYPE type) { diff --git a/Nuake/src/Core/Logger.h b/Nuake/src/Core/Logger.h index 74cb48c0..6c41a49c 100644 --- a/Nuake/src/Core/Logger.h +++ b/Nuake/src/Core/Logger.h @@ -20,11 +20,12 @@ namespace Nuake class Logger { - public: - static void Log(const std::string& log, LOG_TYPE type = VERBOSE); - static std::vector GetLogs(); private: static const int MAX_LOG = 64; static std::vector m_Logs; + + public: + static void Log(const std::string& log, LOG_TYPE type = VERBOSE); + static std::vector GetLogs(); }; } diff --git a/Nuake/src/Core/String.cpp b/Nuake/src/Core/String.cpp index b37ae72c..5263adfb 100644 --- a/Nuake/src/Core/String.cpp +++ b/Nuake/src/Core/String.cpp @@ -2,11 +2,14 @@ #include #include -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 String::Split(const std::string& string, char delimiter) diff --git a/Nuake/src/Core/String.h b/Nuake/src/Core/String.h index 643028ee..29689d8d 100644 --- a/Nuake/src/Core/String.h +++ b/Nuake/src/Core/String.h @@ -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);