All: rename every function from UpperCamelCase to snake_case
This was a mess since I didn't know which to use but now I decided to go with snake_case :)
This commit is contained in:
@@ -19,23 +19,23 @@ namespace BAN
|
||||
~String();
|
||||
|
||||
template<typename... Args>
|
||||
static String Formatted(const char* format, const Args&... args);
|
||||
static String formatted(const char* format, const Args&... args);
|
||||
|
||||
String& operator=(const String&);
|
||||
String& operator=(String&&);
|
||||
String& operator=(StringView);
|
||||
|
||||
[[nodiscard]] ErrorOr<void> PushBack(char);
|
||||
[[nodiscard]] ErrorOr<void> Insert(char, size_type);
|
||||
[[nodiscard]] ErrorOr<void> Insert(StringView, size_type);
|
||||
[[nodiscard]] ErrorOr<void> Append(StringView);
|
||||
[[nodiscard]] ErrorOr<void> Append(const String&);
|
||||
[[nodiscard]] ErrorOr<void> push_back(char);
|
||||
[[nodiscard]] ErrorOr<void> insert(char, size_type);
|
||||
[[nodiscard]] ErrorOr<void> insert(StringView, size_type);
|
||||
[[nodiscard]] ErrorOr<void> append(StringView);
|
||||
[[nodiscard]] ErrorOr<void> append(const String&);
|
||||
|
||||
void PopBack();
|
||||
void Remove(size_type);
|
||||
void Erase(size_type, size_type);
|
||||
void pop_back();
|
||||
void remove(size_type);
|
||||
void erase(size_type, size_type);
|
||||
|
||||
void Clear();
|
||||
void clear();
|
||||
|
||||
char operator[](size_type) const;
|
||||
char& operator[](size_type);
|
||||
@@ -44,34 +44,34 @@ namespace BAN
|
||||
bool operator==(StringView) const;
|
||||
bool operator==(const char*) const;
|
||||
|
||||
[[nodiscard]] ErrorOr<void> Resize(size_type, char = '\0');
|
||||
[[nodiscard]] ErrorOr<void> Reserve(size_type);
|
||||
[[nodiscard]] ErrorOr<void> resize(size_type, char = '\0');
|
||||
[[nodiscard]] ErrorOr<void> reserve(size_type);
|
||||
|
||||
StringView SV() const;
|
||||
StringView sv() const;
|
||||
|
||||
bool Empty() const;
|
||||
size_type Size() const;
|
||||
size_type Capasity() const;
|
||||
bool empty() const;
|
||||
size_type size() const;
|
||||
size_type capacity() const;
|
||||
|
||||
const char* Data() const;
|
||||
const char* data() const;
|
||||
|
||||
private:
|
||||
[[nodiscard]] ErrorOr<void> EnsureCapasity(size_type);
|
||||
[[nodiscard]] ErrorOr<void> ensure_capacity(size_type);
|
||||
|
||||
[[nodiscard]] ErrorOr<void> copy_impl(StringView);
|
||||
void move_impl(String&&);
|
||||
|
||||
private:
|
||||
char* m_data = nullptr;
|
||||
size_type m_capasity = 0;
|
||||
size_type m_capacity = 0;
|
||||
size_type m_size = 0;
|
||||
};
|
||||
|
||||
template<typename... Args>
|
||||
String String::Formatted(const char* format, const Args&... args)
|
||||
String String::formatted(const char* format, const Args&... args)
|
||||
{
|
||||
String result;
|
||||
BAN::Formatter::print([&](char c){ result.PushBack(c); }, format, args...);
|
||||
BAN::Formatter::print([&](char c){ result.push_back(c); }, format, args...);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace BAN::Formatter
|
||||
template<typename F>
|
||||
void print_argument_impl(F putc, const String& string, const ValueFormat&)
|
||||
{
|
||||
for (String::size_type i = 0; i < string.Size(); i++)
|
||||
for (String::size_type i = 0; i < string.size(); i++)
|
||||
putc(string[i]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user