BPackageInfo: Add CanonicalFileName()

The name of the package file is not part of the package-info.
CanonicalFileName() constructs the name the file should have (not
enforced anywhere (yet)).
This commit is contained in:
Ingo Weinhold 2013-04-20 21:10:21 +02:00
parent a3b1c7b96e
commit be8f5e00f1
2 changed files with 13 additions and 0 deletions

View File

@ -89,6 +89,8 @@ public:
FreshensList() const;
const BStringList& ReplacesList() const;
BString CanonicalFileName() const;
void SetName(const BString& name);
void SetSummary(const BString& summary);
void SetDescription(const BString& description);

View File

@ -1590,6 +1590,17 @@ BPackageInfo::ReplacesList() const
}
BString
BPackageInfo::CanonicalFileName() const
{
if (InitCheck() != B_OK)
return BString();
return BString().SetToFormat("%s-%s-%s.hpkg", fName.String(),
fVersion.ToString().String(), kArchitectureNames[fArchitecture]);
}
void
BPackageInfo::SetName(const BString& name)
{