[ox/claw] Add Claw

This commit is contained in:
2020-05-06 20:38:06 -05:00
parent 9560ccf476
commit e2952ec8c1
14 changed files with 493 additions and 9 deletions

View File

@@ -13,7 +13,7 @@ namespace ox {
String::String() noexcept {
if (m_buff.size()) {
m_buff[0] = 0;;
m_buff[0] = 0;
} else {
m_buff.push_back(0);
}
@@ -21,18 +21,24 @@ String::String() noexcept {
String::String(std::size_t cap) noexcept {
m_buff.resize(cap + 1);
m_buff[0] = 0;;
m_buff[0] = 0;
}
String::String(const char *str) noexcept {
if (m_buff.size()) {
m_buff[0] = 0;;
m_buff[0] = 0;
} else {
m_buff.push_back(0);
}
*this = str;
}
String::String(const char *str, std::size_t size) noexcept {
m_buff.resize(size + 1);
memcpy(m_buff.data(), str, size);
m_buff[size] = 0;
}
String::String(String &other) noexcept {
m_buff = other.m_buff;
}

View File

@@ -27,6 +27,8 @@ class String {
String(const char *str) noexcept;
String(const char *str, std::size_t size) noexcept;
String(String&) noexcept;
String(String&&) noexcept;