flatten 20260225
This commit is contained in:
58
tjp/core/string/Str.hpp
Executable file
58
tjp/core/string/Str.hpp
Executable file
@@ -0,0 +1,58 @@
|
||||
// License: Modified MIT (NON-AI)
|
||||
// See the LICENSE file in the root directory for license information.
|
||||
// Copyright 2025 Timothy Prepscius
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Str.h"
|
||||
#include "../containers/StackArray.hpp"
|
||||
|
||||
namespace tjp::core::str {
|
||||
|
||||
TJP_STR_TEMPLATE
|
||||
struct Str
|
||||
{
|
||||
static constexpr int N = CONST_TEMPLATE_N1;
|
||||
using Internal = StackArray<char, N>;
|
||||
using value_type = typename Internal::value_type;
|
||||
using const_iterator_ = typename Internal::const_iterator;
|
||||
|
||||
Internal string;
|
||||
|
||||
Str();
|
||||
Str(size_t size, char initializer);
|
||||
Str(const String &rhs);
|
||||
Str(const StringView &rhs);
|
||||
Str(const char *rhs);
|
||||
Str(const char *begin, const char *end);
|
||||
Str(const StringView &v0, const StringView &v1);
|
||||
|
||||
TJP_STR_TEMPLATE2
|
||||
Str(const TJP_STR2 &rhs);
|
||||
|
||||
explicit Str(const Vector<char> &v);
|
||||
|
||||
operator const StringView () const;
|
||||
bool empty() const;
|
||||
|
||||
void clear();
|
||||
|
||||
const value_type *data() const;
|
||||
const_iterator_ begin() const;
|
||||
const_iterator_ end() const;
|
||||
size_t size () const;
|
||||
|
||||
char front() const;
|
||||
char back() const;
|
||||
|
||||
|
||||
const char *c_str() const;
|
||||
const char *c_str();
|
||||
String toString() const;
|
||||
} ;
|
||||
|
||||
} // namespace
|
||||
|
||||
#ifdef TJP_STR_INLINE
|
||||
#include "Str.inl"
|
||||
#endif
|
||||
Reference in New Issue
Block a user