2017-04-03 16:13:46 -07:00
|
|
|
#include "pch.h"
|
2017-04-27 17:56:06 -07:00
|
|
|
|
2017-10-13 18:37:41 -07:00
|
|
|
#include <vcpkg/base/strings.h>
|
|
|
|
#include <vcpkg/versiont.h>
|
2017-04-03 16:13:46 -07:00
|
|
|
|
|
|
|
namespace vcpkg
|
|
|
|
{
|
2018-04-12 00:47:17 -07:00
|
|
|
VersionT::VersionT() noexcept : value("0.0.0") {}
|
2018-01-27 00:44:07 +02:00
|
|
|
VersionT::VersionT(std::string&& value) : value(std::move(value)) {}
|
2017-12-23 07:29:12 -08:00
|
|
|
VersionT::VersionT(const std::string& value) : value(value) {}
|
2017-11-11 19:47:56 -08:00
|
|
|
const std::string& VersionT::to_string() const { return value; }
|
|
|
|
bool operator==(const VersionT& left, const VersionT& right) { return left.to_string() == right.to_string(); }
|
|
|
|
bool operator!=(const VersionT& left, const VersionT& right) { return left.to_string() != right.to_string(); }
|
|
|
|
std::string to_printf_arg(const VersionT& version) { return version.to_string(); }
|
2017-04-03 16:13:46 -07:00
|
|
|
|
2018-04-12 00:47:17 -07:00
|
|
|
VersionDiff::VersionDiff() noexcept : left(), right() {}
|
2017-04-03 16:18:21 -07:00
|
|
|
VersionDiff::VersionDiff(const VersionT& left, const VersionT& right) : left(left), right(right) {}
|
2017-04-03 16:13:46 -07:00
|
|
|
|
2017-11-11 19:47:56 -08:00
|
|
|
std::string VersionDiff::to_string() const
|
|
|
|
{
|
|
|
|
return Strings::format("%s -> %s", left.to_string(), right.to_string());
|
|
|
|
}
|
2017-04-03 16:13:46 -07:00
|
|
|
}
|