Add base for menu eventhandlerset parsing

This commit is contained in:
Jan
2021-11-06 16:28:24 +01:00
parent b15efd4a4c
commit bf19208351
19 changed files with 334 additions and 46 deletions

View File

@ -0,0 +1,24 @@
#include "GenericMenuEventHandlerSetPropertySequence.h"
#include <utility>
#include "Parsing/Menu/Matcher/MenuMatcherFactory.h"
using namespace menu;
GenericMenuEventHandlerSetPropertySequence::GenericMenuEventHandlerSetPropertySequence(std::string keywordName, callback_t setCallback)
: m_set_callback(std::move(setCallback))
{
const MenuMatcherFactory create(this);
AddMatchers({
create.KeywordIgnoreCase(std::move(keywordName)),
create.Char('{')
});
}
void GenericMenuEventHandlerSetPropertySequence::ProcessMatch(MenuFileParserState* state, SequenceResult<SimpleParserValue>& result) const
{
state->m_current_event_handler_set = std::make_unique<CommonEventHandlerSet>();
state->m_event_handler_set_callback = m_set_callback;
}