From 8698ee4521d87bc735d569fcdf118b8738f8a9a8 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Fri, 24 May 2013 03:08:16 +0200 Subject: [PATCH] BStringList: Declare Join() const --- headers/os/support/StringList.h | 6 ++++-- src/kits/support/StringList.cpp | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/headers/os/support/StringList.h b/headers/os/support/StringList.h index efd3546404..c1938121f2 100644 --- a/headers/os/support/StringList.h +++ b/headers/os/support/StringList.h @@ -53,7 +53,8 @@ public: int32 CountStrings() const; bool IsEmpty() const; - BString Join(const char* separator, int32 length = -1); + BString Join(const char* separator, int32 length = -1) + const; // Iteration void DoForEach(bool (*func)(const BString& string)); @@ -77,7 +78,8 @@ private: void _IncrementRefCounts() const; void _DecrementRefCounts() const; - BString _Join(const char* separator, int32 length); + BString _Join(const char* separator, int32 length) + const; private: BList fStrings; diff --git a/src/kits/support/StringList.cpp b/src/kits/support/StringList.cpp index 20dc9ccd4c..8d51f3f0af 100644 --- a/src/kits/support/StringList.cpp +++ b/src/kits/support/StringList.cpp @@ -276,7 +276,7 @@ BStringList::IsEmpty() const BString -BStringList::Join(const char* separator, int32 length) +BStringList::Join(const char* separator, int32 length) const { return _Join(separator, length >= 0 ? strnlen(separator, length) : strlen(separator)); @@ -434,7 +434,7 @@ BStringList::_DecrementRefCounts() const BString -BStringList::_Join(const char* separator, int32 length) +BStringList::_Join(const char* separator, int32 length) const { // handle simple cases (0 or 1 element) int32 count = CountStrings();