feat(parser): add platform-specific parsers and argument conventions

Implement platform-specific parsers for Windows, Linux, and macOS
Add GNU argument convention implementations
Create fake parser for testing purposes
Update CMakeLists to include new headers
This commit is contained in:
2025-10-03 23:56:54 +04:00
parent ef0a0c06f8
commit ebbf3983de
10 changed files with 190 additions and 23 deletions

View File

@@ -0,0 +1,32 @@
#pragma once
#include <string>
#include <utility>
#ifndef BASE_CONVENTION_HPP
#define BASE_CONVENTION_HPP
namespace argument_parser::conventions {
enum class argument_type {
SHORT,
LONG,
ERROR
};
using parsed_argument = std::pair<argument_type, std::string>;
class base_convention {
public:
virtual std::string extract_value(std::string const&) const = 0;
virtual parsed_argument get_argument(std::string const&) const = 0;
virtual bool requires_next_token() const = 0;
virtual std::string name() const = 0;
virtual std::string short_prec() const = 0;
virtual std::string long_prec() const = 0;
protected:
base_convention() = default;
~base_convention() = default;
};
using convention = base_convention;
}
#endif