Skip to content
Snippets Groups Projects
Commit 2428108f authored by Marco Biasini's avatar Marco Biasini
Browse files

some small helper methods for FixedString

parent 90716321
No related branches found
No related tags found
No related merge requests found
...@@ -55,7 +55,9 @@ public: ...@@ -55,7 +55,9 @@ public:
bool operator!=(const FixedString<LENGTH>& rhs) const { bool operator!=(const FixedString<LENGTH>& rhs) const {
return !this->operator==(rhs); return !this->operator==(rhs);
} }
size_t capacity() const {
return LENGTH;
}
FixedString<LENGTH>& operator=(const String& rhs) { FixedString<LENGTH>& operator=(const String& rhs) {
this->assign(rhs); this->assign(rhs);
return *this; return *this;
...@@ -68,6 +70,8 @@ public: ...@@ -68,6 +70,8 @@ public:
const char* c_str() const { const char* c_str() const {
return bytes_; return bytes_;
} }
char* data() { return bytes_; }
const char* data() const { return bytes_; }
private: private:
void assign(const String& str) { void assign(const String& str) {
assert(str.length()<=LENGTH); assert(str.length()<=LENGTH);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment