package daemon: Package: Add RevisionedName[Throws]()
This commit is contained in:
@@ -70,3 +70,21 @@ Package::Init(const entry_ref& entryRef)
|
|||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BString
|
||||||
|
Package::RevisionedName() const
|
||||||
|
{
|
||||||
|
return BString().SetToFormat("%s-%s", fInfo.Name().String(),
|
||||||
|
fInfo.Version().ToString().String());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BString
|
||||||
|
Package::RevisionedNameThrows() const
|
||||||
|
{
|
||||||
|
BString result(RevisionedName());
|
||||||
|
if (result.IsEmpty())
|
||||||
|
throw std::bad_alloc();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|||||||
@@ -36,6 +36,9 @@ public:
|
|||||||
const BPackageInfo & Info() const
|
const BPackageInfo & Info() const
|
||||||
{ return fInfo; }
|
{ return fInfo; }
|
||||||
|
|
||||||
|
BString RevisionedName() const;
|
||||||
|
BString RevisionedNameThrows() const;
|
||||||
|
|
||||||
bool IsActive() const
|
bool IsActive() const
|
||||||
{ return fActive; }
|
{ return fActive; }
|
||||||
void SetActive(bool active)
|
void SetActive(bool active)
|
||||||
|
|||||||
Reference in New Issue
Block a user