blob: 7fcf81d1170ffaf7da52e66f719d79479f6895e1 [file] [log] [blame]
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <optional>
#include <string>
// Represents a semantic version.
class Version {
Version(int major, int minor, int patch);
static std::optional<Version> FromString(std::string s);
int major() const { return major_; }
int minor() const { return minor_; }
int patch() const { return patch_; }
bool operator==(const Version& other) const;
bool operator<(const Version& other) const;
bool operator!=(const Version& other) const;
bool operator>=(const Version& other) const;
bool operator>(const Version& other) const;
bool operator<=(const Version& other) const;
std::string Describe() const;
int major_;
int minor_;
int patch_;