mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-21 00:25:44 +00:00
33 lines
1.1 KiB
C++
33 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <functional>
|
|
|
|
#include "Parsing/Menu/MenuFileParser.h"
|
|
#include "Parsing/Menu/Domain/Expression/ICommonExpression.h"
|
|
|
|
namespace menu
|
|
{
|
|
class GenericExpressionPropertySequence final : public MenuFileParser::sequence_t
|
|
{
|
|
public:
|
|
using callback_t = std::function<void(MenuFileParserState* state, std::unique_ptr<ICommonExpression> value)>;
|
|
|
|
private:
|
|
static constexpr auto CAPTURE_VALUE = 1;
|
|
|
|
const callback_t m_set_callback;
|
|
|
|
protected:
|
|
void ProcessMatch(MenuFileParserState* state, SequenceResult<SimpleParserValue>& result) const override;
|
|
|
|
private:
|
|
explicit GenericExpressionPropertySequence(callback_t setCallback);
|
|
|
|
public:
|
|
static std::unique_ptr<GenericExpressionPropertySequence> WithKeyword(std::string keyword, callback_t setCallback);
|
|
static std::unique_ptr<GenericExpressionPropertySequence> WithKeywords(std::initializer_list<std::string> keywords, callback_t setCallback);
|
|
static std::unique_ptr<GenericExpressionPropertySequence> WithKeywordAndBool(std::string keyword, callback_t setCallback);
|
|
};
|
|
}
|