mirror of
https://github.com/cemu-project/vcpkg.git
synced 2025-02-25 12:03:32 +01:00
24 lines
986 B
C++
24 lines
986 B
C++
#include "pch.h"
|
|
|
|
#include <vcpkg/base/strings.h>
|
|
#include <vcpkg/versiont.h>
|
|
|
|
namespace vcpkg
|
|
{
|
|
VersionT::VersionT() noexcept : value("0.0.0") {}
|
|
VersionT::VersionT(std::string&& value) : value(std::move(value)) {}
|
|
VersionT::VersionT(const std::string& value) : value(value) {}
|
|
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(); }
|
|
|
|
VersionDiff::VersionDiff() noexcept : 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.to_string(), right.to_string());
|
|
}
|
|
}
|