25a7b01d15
Additional changes: * Add src/system/kernel/lib/zlib, which builds a kernel version of zlib, needed by packagefs. * BuildFeatures: Add a build feature "gcc2" to allow for easier checks. * Referenceable.cpp: Include <OS.h> instead of <debugger.h>. The latter is not needed and prevents building for the build platform. * zlib/zutil.h: Fix gcc 2 build. We really should use the external package instead. Conflicts: .gitignore build/jam/BuildSetup build/jam/FileRules build/jam/FloppyBootImage build/jam/HaikuImage build/jam/ImageRules build/jam/KernelRules build/jam/NetBootArchive build/jam/OptionalBuildFeatures build/jam/OptionalLibPackages build/jam/OptionalPackageDependencies build/jam/OptionalPackages build/scripts/build_haiku_image configure data/bin/installoptionalpackage data/system/boot/Bootscript headers/os/app/Message.h headers/os/package/PackageInfo.h headers/os/package/PackageInfoAttributes.h headers/os/package/PackageInfoSet.h headers/os/package/PackageRoster.h headers/os/package/PackageVersion.h headers/os/package/hpkg/PackageInfoAttributeValue.h headers/os/storage/FindDirectory.h headers/os/storage/Node.h headers/os/support/StringList.h headers/private/system/directories.h src/add-ons/kernel/drivers/audio/ac97/es1370/Jamfile src/add-ons/kernel/file_systems/packagefs/AttributeIndex.cpp src/add-ons/kernel/file_systems/packagefs/Jamfile src/add-ons/kernel/file_systems/packagefs/Package.cpp src/add-ons/kernel/file_systems/packagefs/Package.h src/add-ons/kernel/file_systems/packagefs/PackageDomain.cpp src/add-ons/kernel/file_systems/packagefs/PackageDomain.h src/add-ons/kernel/file_systems/packagefs/PackageFSRoot.cpp src/add-ons/kernel/file_systems/packagefs/PackageLinkDirectory.cpp src/add-ons/kernel/file_systems/packagefs/PackageLinkDirectory.h src/add-ons/kernel/file_systems/packagefs/PackageLinkSymlink.cpp src/add-ons/kernel/file_systems/packagefs/PackageLinkSymlink.h src/add-ons/kernel/file_systems/packagefs/PackageLinksDirectory.cpp src/add-ons/kernel/file_systems/packagefs/PackageNode.h src/add-ons/kernel/file_systems/packagefs/ResolvableFamily.cpp src/add-ons/kernel/file_systems/packagefs/Version.cpp src/add-ons/kernel/file_systems/packagefs/Version.h src/add-ons/kernel/file_systems/packagefs/Volume.cpp src/add-ons/kernel/file_systems/packagefs/Volume.h src/add-ons/kernel/file_systems/packagefs/kernel_interface.cpp src/add-ons/kernel/file_systems/userlandfs/shared/driver_settings.c src/apps/deskbar/BarApp.cpp src/apps/deskbar/BarMenuBar.cpp src/apps/deskbar/BarMenuBar.h src/apps/deskbar/BarView.cpp src/apps/deskbar/BarView.h src/apps/deskbar/BarWindow.cpp src/apps/deskbar/BarWindow.h src/apps/deskbar/DeskbarMenu.cpp src/apps/deskbar/DeskbarMenu.h src/apps/deskbar/DeskbarUtils.cpp src/apps/deskbar/DeskbarUtils.h src/apps/deskbar/ExpandoMenuBar.cpp src/apps/deskbar/ExpandoMenuBar.h src/apps/deskbar/TeamMenu.cpp src/apps/processcontroller/ProcessController.cpp src/apps/remotedesktop/RemoteDesktop.cpp src/bin/bash/config-top.h src/bin/finddir.c src/bin/package/Jamfile src/bin/package/command_add.cpp src/bin/package/command_create.cpp src/bin/package/command_list.cpp src/bin/package_repo/command_list.cpp src/bin/pkgman/command_refresh.cpp src/build/libbe/support/Jamfile src/build/libpackage/Jamfile src/build/libroot/Jamfile src/build/libroot/fs.cpp src/build/libroot/remapped_functions.h src/kits/locale/MutableLocaleRoster.cpp src/kits/opengl/GLRendererRoster.cpp src/kits/package/PackageInfo.cpp src/kits/package/PackageInfoSet.cpp src/kits/package/PackageRoster.cpp src/kits/package/PackageVersion.cpp src/kits/package/RepositoryCache.cpp src/kits/package/hpkg/PackageWriterImpl.cpp src/kits/package/hpkg/ReaderImplBase.cpp src/kits/package/hpkg/WriterImplBase.cpp src/kits/print/PrintTransport.cpp src/kits/print/Printer.cpp src/kits/screensaver/ScreenSaverRunner.cpp src/kits/support/StringList.cpp src/kits/tracker/ContainerWindow.cpp src/kits/tracker/DeskWindow.cpp src/kits/tracker/PoseView.cpp src/libs/print/libprint/Transport.cpp src/preferences/printers/AddPrinterDialog.cpp src/preferences/screensaver/ScreenSaverWindow.cpp src/servers/debug/DebugServer.cpp src/servers/input/AddOnManager.cpp src/servers/media_addon/MediaAddonServer.cpp src/system/boot/Jamfile src/system/boot/loader/Jamfile src/system/boot/loader/loader.cpp src/system/boot/loader/vfs.cpp src/system/kernel/fs/vfs.cpp src/system/kernel/fs/vfs_boot.cpp src/system/libroot/os/find_directory.cpp src/system/runtime_loader/runtime_loader.cpp src/tools/package/Jamfile
102 lines
2.7 KiB
C++
102 lines
2.7 KiB
C++
/*
|
|
* Copyright 2011, Haiku, Inc. All Rights Reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef _SUPPORT_BSTRING_LIST_H_
|
|
#define _SUPPORT_BSTRING_LIST_H_
|
|
|
|
|
|
#include <BeBuild.h>
|
|
#include <Flattenable.h>
|
|
#include <List.h>
|
|
#include <String.h>
|
|
|
|
|
|
class BStringList : public BFlattenable {
|
|
public:
|
|
BStringList(int32 count = 20);
|
|
BStringList(const BStringList& other);
|
|
virtual ~BStringList();
|
|
|
|
// Adding and removing items.
|
|
bool Add(const BString& string, int32 index);
|
|
bool Add(const BString& string);
|
|
bool Add(const BStringList& list, int32 index);
|
|
bool Add(const BStringList& list);
|
|
|
|
bool Remove(const BString& string,
|
|
bool ignoreCase = false);
|
|
bool Remove(const BStringList& list,
|
|
bool ignoreCase = false);
|
|
BString Remove(int32 index);
|
|
bool Remove(int32 index, int32 count);
|
|
bool Replace(int32 index, const BString& string);
|
|
|
|
void MakeEmpty();
|
|
|
|
// Reorder items
|
|
void Sort(bool ignoreCase = false);
|
|
// TODO: Sort() with custom sort function.
|
|
bool Swap(int32 indexA, int32 indexB);
|
|
bool Move(int32 fromIndex, int32 toIndex);
|
|
|
|
// Retrieve items
|
|
BString StringAt(int32 index) const;
|
|
BString First() const;
|
|
BString Last() const;
|
|
|
|
// Query
|
|
bool HasString(const BString& string,
|
|
bool ignoreCase = false) const;
|
|
int32 IndexOf(const BString& string,
|
|
bool ignoreCase = false) const;
|
|
int32 CountStrings() const;
|
|
bool IsEmpty() const;
|
|
|
|
BString Join(const char* separator, int32 length = -1);
|
|
|
|
// Iteration
|
|
void DoForEach(bool (*func)(const BString& string));
|
|
void DoForEach(bool (*func)(const BString& string,
|
|
void* arg2), void* arg2);
|
|
|
|
BStringList& operator=(const BStringList& other);
|
|
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;
|
|
|
|
BString _Join(const char* separator, int32 length);
|
|
|
|
private:
|
|
BList fStrings;
|
|
};
|
|
|
|
|
|
inline bool
|
|
BStringList::HasString(const BString& string, bool ignoreCase) const
|
|
{
|
|
return IndexOf(string, ignoreCase) >= 0;
|
|
}
|
|
|
|
|
|
inline bool
|
|
BStringList::operator!=(const BStringList& other) const
|
|
{
|
|
return !(*this == other);
|
|
}
|
|
|
|
|
|
#endif // _SUPPORT_BSTRING_LIST_H_
|