some more early thoughts about syntax

This commit is contained in:
Blue 2023-08-31 17:06:02 -03:00
parent 0c40906eca
commit 60b2220b97
Signed by: blue
GPG key ID: 9B203B252A63EE38
7 changed files with 170 additions and 5 deletions

31
src/dependency.h Normal file
View file

@ -0,0 +1,31 @@
#pragma once
#include <string>
#include <optional>
class Dependency {
public:
enum class Type {
automatic,
simple,
mason
};
Dependency(
const std::string& path,
Type type = Type::automatic,
const std::optional<std::string>& name = std::nullopt,
const std::optional<std::string>& version = std::nullopt
);
Type getType() const;
std::optional<std::string> getName() const;
std::optional<std::string> getVersion() const;
const std::string path;
private:
Type type;
std::optional<std::string> name;
std::optional<std::string> version;
};