clean seafile api
This commit is contained in:
1 parent
3e4694ceb5
commit
f0c5de374e
4 files changed
+30
-38
No files matched your search
@@ -6,10 +6,9 @@
|
||||
#define SEADISK_VERSION_HPP
|
||||
#include <string>
|
||||
#include <optional>
|
||||
#include <compare>
|
||||
|
||||
namespace seafile::util
|
||||
{
|
||||
|
||||
namespace seafile::util {
|
||||
/**
|
||||
* @brief Semantic version parser.
|
||||
*
|
||||
@@ -18,12 +17,19 @@ namespace seafile::util
|
||||
* 10.0
|
||||
* 10.0.2
|
||||
*/
|
||||
class Version final
|
||||
{
|
||||
class Version final {
|
||||
public:
|
||||
Version() = default;
|
||||
|
||||
explicit Version(const std::string& version);
|
||||
explicit Version(const std::string &version);
|
||||
|
||||
Version(const Version &) = default;
|
||||
|
||||
Version(Version &&) noexcept = default;
|
||||
|
||||
Version &operator=(const Version &) = default;
|
||||
|
||||
Version &operator=(Version &&) noexcept = default;
|
||||
|
||||
[[nodiscard]]
|
||||
int major() const noexcept;
|
||||
@@ -37,19 +43,14 @@ namespace seafile::util
|
||||
[[nodiscard]]
|
||||
std::string toString() const;
|
||||
|
||||
bool operator==(const Version& other) const;
|
||||
|
||||
bool operator<(const Version& other) const;
|
||||
|
||||
std::strong_ordering operator<=>(const Version &other) const;
|
||||
|
||||
private:
|
||||
void parse(const std::string& version);
|
||||
void parse(const std::string &version);
|
||||
|
||||
private:
|
||||
int major_{0};
|
||||
std::optional<int> minor_;
|
||||
std::optional<int> patch_;
|
||||
};
|
||||
|
||||
}
|
||||
#endif //SEADISK_VERSION_HPP
|
||||
Reference in new issue
Block a user