diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-23 17:28:53 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-23 17:28:53 +0100 |
| commit | 44d81cab1e376abc149e290226ef3915aa35ff74 (patch) | |
| tree | c21b455ef076277c7fddfacc6e261f5f81f143fb | |
| parent | b7c27ed1b5e6fb48b3106f8eaffd415aa89ae6dc (diff) | |
Minor refactors.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
| -rw-r--r-- | CompilerKit/ParserKit.hpp | 3 | ||||
| -rw-r--r-- | CompilerKit/StdKit/Ref.hpp | 12 | ||||
| -rw-r--r-- | CompilerKit/StdKit/String.cc | 12 |
3 files changed, 19 insertions, 8 deletions
diff --git a/CompilerKit/ParserKit.hpp b/CompilerKit/ParserKit.hpp index 3292b07..49907e5 100644 --- a/CompilerKit/ParserKit.hpp +++ b/CompilerKit/ParserKit.hpp @@ -107,4 +107,5 @@ namespace ParserKit return false; } -}
\ No newline at end of file +} + diff --git a/CompilerKit/StdKit/Ref.hpp b/CompilerKit/StdKit/Ref.hpp index d2d5b34..9b79ca9 100644 --- a/CompilerKit/StdKit/Ref.hpp +++ b/CompilerKit/StdKit/Ref.hpp @@ -10,23 +10,21 @@ #pragma once -#include <CompilerKit/Defines.hpp> - namespace CompilerKit { - // @author Mahrouss Logic + // @author Amlal EL Mahrouss // @brief Reference class, refers to a pointer of data in static memory. template <typename T> class Ref final { public: - Ref() = default; + explicit Ref() = default; ~Ref() = default; public: - Ref(T cls, const bool &strong = false) : m_Class(cls), m_Strong(strong) {} + explicit Ref(T cls, const bool &strong = false) : m_Class(cls), m_Strong(strong) {} - Ref &operator=(T ref) + Ref& operator=(T ref) { m_Class = ref; return *this; @@ -71,7 +69,7 @@ namespace CompilerKit NonNullRef() = delete; NonNullRef(nullPtr) = delete; - NonNullRef(T *ref) : m_Ref(ref, true) {} + explicit NonNullRef(T *ref) : m_Ref(ref, true) {} Ref<T> &operator->() { diff --git a/CompilerKit/StdKit/String.cc b/CompilerKit/StdKit/String.cc index bb0e3dd..45662ef 100644 --- a/CompilerKit/StdKit/String.cc +++ b/CompilerKit/StdKit/String.cc @@ -7,6 +7,17 @@ * ======================================================== */ +/** + * @file String.cc + * @author Amlal (amlal@mahrouss-logic.com) + * @brief String manipulation API. + * @version 0.1 + * @date 2024-01-23 + * + * @copyright Copyright (c) 2024 Mahrouss Logic + * + */ + #include "String.hpp" #include <utility> @@ -222,6 +233,7 @@ namespace CompilerKit StringView &StringView::operator+=(const StringView &rhs) { this->m_Data += rhs.CData(); + this->m_Cur = this->m_Data.size(); this->m_Sz = this->m_Data.size(); |
