vcpkg/toolsrc/src/VersionT.cpp

20 lines
819 B
C++
Raw Normal View History

2017-04-04 07:13:46 +08:00
#include "pch.h"
2017-04-04 07:13:46 +08:00
#include "VersionT.h"
#include "vcpkg_Strings.h"
namespace vcpkg
{
VersionT::VersionT() : value("0.0.0") {}
VersionT::VersionT(const std::string& value) : value(value) {}
std::string VersionT::to_string() const { return value; }
2017-04-04 07:13:46 +08:00
bool operator==(const VersionT& left, const VersionT& right) { return left.value == right.value; }
bool operator!=(const VersionT& left, const VersionT& right) { return left.value != right.value; }
std::string to_printf_arg(const VersionT& version) { return version.value; }
2017-04-04 07:18:21 +08:00
VersionDiff::VersionDiff() : left(), right() {}
VersionDiff::VersionDiff(const VersionT& left, const VersionT& right) : left(left), right(right) {}
2017-04-04 07:13:46 +08:00
std::string VersionDiff::to_string() const { return Strings::format("%s -> %s", left.value, right.value); }
2017-04-04 07:13:46 +08:00
}