cemu-vcpkg/toolsrc/src/vcpkg/versiont.cpp

24 lines
986 B
C++
Raw Normal View History

2017-04-03 16:13:46 -07:00
#include "pch.h"
#include <vcpkg/base/strings.h>
#include <vcpkg/versiont.h>
2017-04-03 16:13:46 -07:00
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(); }
2017-04-03 16:13:46 -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
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
}