Make BStringList derive from BFlattenable. The implementation is more or less copied from the mail version to stay compatible. Fix IndexOf which
was the implementation of HasString.
This commit is contained in:
@@ -7,11 +7,12 @@
|
||||
|
||||
|
||||
#include <BeBuild.h>
|
||||
#include <Flattenable.h>
|
||||
#include <List.h>
|
||||
#include <String.h>
|
||||
|
||||
|
||||
class BStringList {
|
||||
class BStringList : public BFlattenable {
|
||||
public:
|
||||
BStringList(int32 count = 20);
|
||||
BStringList(const BStringList& other);
|
||||
@@ -25,6 +26,8 @@ public:
|
||||
|
||||
bool Remove(const BString& string,
|
||||
bool ignoreCase = false);
|
||||
void Remove(const BStringList& list,
|
||||
bool ignoreCase = false);
|
||||
BString Remove(int32 index);
|
||||
bool Remove(int32 index, int32 count);
|
||||
bool Replace(int32 index, const BString& string);
|
||||
@@ -59,6 +62,15 @@ public:
|
||||
bool operator==(const BStringList& other) const;
|
||||
bool operator!=(const BStringList& other) const;
|
||||
|
||||
// BFlattenable
|
||||
virtual bool IsFixedSize() const;
|
||||
virtual type_code TypeCode() const;
|
||||
virtual bool AllowsTypeCode(type_code code) const;
|
||||
virtual ssize_t FlattenedSize() const;
|
||||
virtual status_t Flatten(void* buffer, ssize_t size) const;
|
||||
virtual status_t Unflatten(type_code code, const void* buffer,
|
||||
ssize_t size);
|
||||
|
||||
private:
|
||||
void _IncrementRefCounts() const;
|
||||
void _DecrementRefCounts() const;
|
||||
|
||||
Reference in New Issue
Block a user