Exemplo n.º 1
0
//zwraca:
// 1 jeśli this jest > od pV,
// -1 jeśli this jest < od pV,
// 0 jeśli równe
int ProjectVersion::compare(const ProjectVersion& pV) const
{
    if (getStatus() != Status::Filled && pV.getStatus() == Status::Filled)
        return -1;
    if (getStatus() == Status::Filled && pV.getStatus() != Status::Filled)
        return 1;
    if (getStatus() != Status::Filled && pV.getStatus() != Status::Filled)
        return 0;

    if (majorN < pV.majorN)
        return -1;
    if (majorN > pV.majorN)
        return 1;

    if (minorN < pV.minorN)
        return -1;
    if (minorN > pV.minorN)
        return 1;

    if (release < pV.release)
        return -1;
    if (release > pV.release)
        return 1;

    if ( build < pV.build)
        return -1;
    if ( build > pV.build)
        return 1;

    return extCompare(pV);
}