Rename String::get_length

This commit is contained in:
karl 2021-05-04 11:41:46 +02:00
parent 482116018f
commit 307d000253
2 changed files with 4 additions and 6 deletions

View File

@ -5,13 +5,11 @@ namespace Gedeng {
String::String() : String("") {
}
String::String(const char *stringText)
: length(strlen(stringText)), text(new char[length + sizeof(char)]) {
String::String(const char *stringText) : length(strlen(stringText)), text(new char[length + sizeof(char)]) {
memcpy(text, stringText, length + sizeof(char));
}
String::String(const String &other)
: length(other.getLength()), text(new char[length + sizeof(char)]) {
String::String(const String &other) : length(other.get_length()), text(new char[length + sizeof(char)]) {
memcpy(text, other.c_str(), length + sizeof(char));
}
@ -116,7 +114,7 @@ const char *String::c_str() const {
return text;
}
size_t String::getLength() const {
size_t String::get_length() const {
return length;
}

View File

@ -48,7 +48,7 @@ class String {
const char *c_str() const;
/// Return the length of the String (without the terminator).
size_t getLength() const;
size_t get_length() const;
private:
size_t length;