From 2428108f8910d969ac0c961556c7f496c779f06d Mon Sep 17 00:00:00 2001 From: Marco Biasini <marco.biasini@unibas.ch> Date: Tue, 19 Oct 2010 13:22:48 +0200 Subject: [PATCH] some small helper methods for FixedString --- modules/base/src/fixed_string.hh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/base/src/fixed_string.hh b/modules/base/src/fixed_string.hh index a7858cf06..fac1ba6cd 100644 --- a/modules/base/src/fixed_string.hh +++ b/modules/base/src/fixed_string.hh @@ -55,7 +55,9 @@ public: bool operator!=(const FixedString<LENGTH>& rhs) const { return !this->operator==(rhs); } - + size_t capacity() const { + return LENGTH; + } FixedString<LENGTH>& operator=(const String& rhs) { this->assign(rhs); return *this; @@ -68,6 +70,8 @@ public: const char* c_str() const { return bytes_; } + char* data() { return bytes_; } + const char* data() const { return bytes_; } private: void assign(const String& str) { assert(str.length()<=LENGTH); -- GitLab