Skip to content

Commit

Permalink
HaikuDepot: Definition for stability rating
Browse files Browse the repository at this point in the history
  • Loading branch information
stippi committed Sep 26, 2014
1 parent a4a9dad commit 967a281
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
52 changes: 52 additions & 0 deletions src/apps/haikudepot/PackageInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,58 @@ RatingSummary::operator!=(const RatingSummary& other) const
}


// #pragma mark - StabilityRating


StabilityRating::StabilityRating()
:
fLabel(),
fName()
{
}


StabilityRating::StabilityRating(const BString& label,
const BString& name)
:
fLabel(label),
fName(name)
{
}


StabilityRating::StabilityRating(const StabilityRating& other)
:
fLabel(other.fLabel),
fName(other.fName)
{
}


StabilityRating&
StabilityRating::operator=(const StabilityRating& other)
{
fLabel = other.fLabel;
fName = other.fName;
return *this;
}


bool
StabilityRating::operator==(const StabilityRating& other) const
{
return fLabel == other.fLabel
&& fName == other.fName;
}


bool
StabilityRating::operator!=(const StabilityRating& other) const
{
return !(*this == other);
}


// #pragma mark - PublisherInfo


Expand Down
25 changes: 25 additions & 0 deletions src/apps/haikudepot/PackageInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,31 @@ class RatingSummary {
};


class StabilityRating {
public:
StabilityRating();
StabilityRating(
const BString& label,
const BString& name);
StabilityRating(const StabilityRating& other);

StabilityRating& operator=(const StabilityRating& other);
bool operator==(const StabilityRating& other) const;
bool operator!=(const StabilityRating& other) const;

const BString& Label() const
{ return fLabel; }
const BString& Name() const
{ return fName; }
private:
BString fLabel;
BString fName;
};


typedef List<StabilityRating, false> StabilityRatingList;


class PublisherInfo {
public:
PublisherInfo();
Expand Down

0 comments on commit 967a281

Please sign in to comment.