-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
In an OOP environment the GlobalMatch callback functionality is very restrictive.
Would it be possible to implement a base callback class with a callback virtual function to later build upon this class, ?
I tried below but I have difficulties with syntax since I am not much experienced with c++.
Could ypu please help to fix below - or suggest something similar - and if works it might be a good candidate for an MR.
In regexp.h :
class GlobalMatchClass;
typedef void (*GlobalMatchClassCallback) (GlobalMatchClass::*matchcallback)(const char* match, const unsigned int length, const MatchState& ms);
typedef class GlobalMatchClass
{
public:
virtual void matchcallback(const char* match, const unsigned int length, const MatchState& ms);
} GlobalMatchClass;
In regexp.cpp:
unsigned int MatchState::GlobalMatchCM(const char* pattern, GlobalMatchClassCallback f)
{
// Same as MatchState::GlobalMatch, probably invocation of f must be different
}
void GlobalMatchClass::matchcallback(const char* match, const unsigned int length, const MatchState& ms) {}
The code above is not correct, has either syntactical or semantical issues, I am not quite sure what is wrong.
Appreciate your help in advance.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels