BStringList: Declare Join() const

This commit is contained in:
Ingo Weinhold 2013-05-24 03:08:16 +02:00
parent bf88057b26
commit 8698ee4521
2 changed files with 6 additions and 4 deletions

View File

@ -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;

View File

@ -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();