From 09dd11ddf800898c00ecb04a65fb5cd10fb481fa Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Wed, 8 May 2024 12:32:41 +0200 Subject: MHR-23: :boom: changes, reworked project tree. Signed-off-by: Amlal El Mahrouss --- Private/NewKit/String.hpp | 76 ----------------------------------------------- 1 file changed, 76 deletions(-) delete mode 100644 Private/NewKit/String.hpp (limited to 'Private/NewKit/String.hpp') diff --git a/Private/NewKit/String.hpp b/Private/NewKit/String.hpp deleted file mode 100644 index 7346c5e9..00000000 --- a/Private/NewKit/String.hpp +++ /dev/null @@ -1,76 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - -------------------------------------------- */ - -#pragma once - -#include -#include -#include - -namespace NewOS -{ - class StringView final - { - public: - explicit StringView() = default; - - explicit StringView(Size Sz) - : fSz(Sz) - { - MUST_PASS(Sz > 1); - fData = new Char[Sz]; - MUST_PASS(fData); - } - - ~StringView() - { - if (fData) - delete[] fData; - } - - StringView& operator=(const StringView&) = default; - StringView(const StringView&) = default; - - Char* Data(); - const Char* CData(); - Size Length() const; - - bool operator==(const Char* rhs) const; - bool operator!=(const Char* rhs) const; - - bool operator==(const StringView& rhs) const; - bool operator!=(const StringView& rhs) const; - - StringView& operator+=(const Char* rhs); - StringView& operator+=(const StringView& rhs); - - operator bool() - { - return fData; - } - - bool operator!() - { - return fData; - } - - private: - Char* fData{nullptr}; - Size fSz{0}; - Size fCur{0}; - - friend class StringBuilder; - }; - - struct StringBuilder final - { - static ErrorOr Construct(const Char* data); - static const char* FromInt(const char* fmt, int n); - static const char* FromBool(const char* fmt, bool n); - static const char* Format(const char* fmt, const char* from); - static bool Equals(const char* lhs, const char* rhs); - }; -} // namespace NewOS -- cgit v1.2.3