summaryrefslogtreecommitdiff
path: root/include/fud_string.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/fud_string.hpp')
-rw-r--r--include/fud_string.hpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/include/fud_string.hpp b/include/fud_string.hpp
index df03ad9..d2d3761 100644
--- a/include/fud_string.hpp
+++ b/include/fud_string.hpp
@@ -20,10 +20,11 @@
#include "fud_allocator.hpp"
#include "fud_assert.hpp"
+#include "fud_c_string.hpp"
+#include "fud_option.hpp"
#include "fud_result.hpp"
#include "fud_status.hpp"
#include "fud_string_view.hpp"
-#include "fud_c_string.hpp"
#include "fud_utf8.hpp"
#include <climits>
@@ -65,7 +66,7 @@ class String {
Array<size_t, sizeof...(cStrings)> lengths{};
Array<const char*, sizeof...(cStrings)> strPointers{};
size_t index = 0;
- for (const auto* cStringItem: {cStrings...}) {
+ for (const auto* cStringItem : {cStrings...}) {
const char* cString = nullptr;
if constexpr (std::is_same_v<decltype(cStringItem), const char*>) {
cString = cStringItem;
@@ -106,7 +107,11 @@ class String {
size_t cumulativeLength = 0;
for (size_t idx = 0; idx < strPointers.size(); ++idx) {
const auto* cString = strPointers[idx];
- auto copyStatus = copyMem(data + cumulativeLength, output.m_capacity - cumulativeLength, cString, lengths[idx]);
+ auto copyStatus = copyMem(
+ data + cumulativeLength,
+ output.m_capacity - cumulativeLength,
+ cString,
+ lengths[idx]);
fudAssert(copyStatus == FudStatus::Success);
cumulativeLength += lengths[idx];
}
@@ -189,7 +194,7 @@ class String {
FudStatus reserve(size_t newCapacity);
- [[nodiscard]] std::optional<utf8> back();
+ [[nodiscard]] Option<utf8> back();
[[nodiscard]] constexpr size_t remainingLength() const
{
@@ -211,7 +216,7 @@ class String {
FudStatus pushBack(const FudUtf8& letter);
- std::optional<utf8> pop();
+ Option<utf8> pop();
FudStatus append(const char* source);