mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 19:18:59 +08:00
22 lines
834 B
C++
22 lines
834 B
C++
#include "pch.h"
|
|
#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; }
|
|
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; }
|
|
|
|
VersionDiff::VersionDiff() : left(), right() {}
|
|
VersionDiff::VersionDiff(const VersionT& left, const VersionT& right) : left(left), right(right) {}
|
|
|
|
std::string VersionDiff::to_string() const
|
|
{
|
|
return Strings::format("%s -> %s", left.value, right.value);
|
|
}
|
|
}
|