Add BSolverPackageSpecifierList::AppendSpecifiers()

This commit is contained in:
Ingo Weinhold 2013-09-10 18:36:40 +02:00
parent 94dc74b027
commit 9b2fd34196
2 changed files with 20 additions and 1 deletions

View File

@ -31,6 +31,9 @@ public:
const BSolverPackageSpecifier& specifier);
bool AppendSpecifier(BSolverPackage* package);
bool AppendSpecifier(const BString& selectString);
bool AppendSpecifiers(
const char* const* selectStrings,
int32 count);
void MakeEmpty();
BSolverPackageSpecifierList& operator=(

View File

@ -40,7 +40,7 @@ BSolverPackageSpecifierList::BSolverPackageSpecifierList()
{
}
BSolverPackageSpecifierList::BSolverPackageSpecifierList(
const BSolverPackageSpecifierList& other)
:
@ -115,6 +115,22 @@ BSolverPackageSpecifierList::AppendSpecifier(const BString& selectString)
}
bool
BSolverPackageSpecifierList::AppendSpecifiers(const char* const* selectStrings,
int32 count)
{
for (int32 i = 0; i < count; i++) {
if (!AppendSpecifier(selectStrings[i])) {
for (int32 k = i - 1; k >= 0; k--)
fSpecifiers->pop_back();
return false;
}
}
return true;
}
void
BSolverPackageSpecifierList::MakeEmpty()
{