haiku/headers/os/package/PackageVersion.h
Oliver Tappe 0d68f6afb3 Implemented repository writing:
* fleshed out RepositoryWriterImpl
* renamed BRepositoryHeader to BRepositoryInfo (in accordance with
  BPackageInfo)
* adjusted BRepositoryInfo to be able to parse itself from a
  driver_settings file
* added package_repo binary (only 'create' works as of yet)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40405 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-02-09 19:11:23 +00:00

60 lines
1.2 KiB
C++

/*
* Copyright 2011, Haiku, Inc.
* Distributed under the terms of the MIT License.
*/
#ifndef _PACKAGE__PACKAGE_VERSION_H_
#define _PACKAGE__PACKAGE_VERSION_H_
#include <String.h>
namespace BPackageKit {
namespace BHPKG {
class BPackageVersionData;
}
using BHPKG::BPackageVersionData;
class BPackageVersion {
public:
BPackageVersion();
BPackageVersion(
const BPackageVersionData& data);
BPackageVersion(const BString& major,
const BString& minor, const BString& micro,
uint8 release);
status_t InitCheck() const;
const BString& Major() const;
const BString& Minor() const;
const BString& Micro() const;
uint8 Release() const;
BString ToString() const;
void SetTo(const BString& major,
const BString& minor, const BString& micro,
uint8 release);
void Clear();
int Compare(const BPackageVersion& other) const;
// does a natural compare over major, minor
// and micro, finally comparing release
private:
BString fMajor;
BString fMinor;
BString fMicro;
uint8 fRelease;
};
} // namespace BPackageKit
#endif // _PACKAGE__PACKAGE_VERSION_H_