-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMarkupParser.h
39 lines (33 loc) · 1.44 KB
/
MarkupParser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//---------------------------------------------------------------------------
#ifndef MarkupParserH
#define MarkupParserH
//---------------------------------------------------------------------------
#include <stdlib.h>
#include <SysUtils.hpp>
#include <Controls.hpp>
#include <Classes.hpp>
#include <Forms.hpp>
//---------------------------------------------------------------------------
enum _TokType {EL_NON, EL_TEX, EL_TAG, EL_COM, EL_SCR};
typedef _TokType TokType;
//---------------------------------------------------------------------------
typedef void __fastcall (__closure *TMarkupNotifyEvent)(System::TObject* Sender, TokType TT, AnsiString *Content, int Row, int Col);
//---------------------------------------------------------------------------
class PACKAGE TMarkupParser : public TComponent
{
private:
TMarkupNotifyEvent FOnMarkupElement;
int FNumberOfElements;
bool FRemoveCRLF;
protected:
void __fastcall SetRemoveCRLF(bool rc);
public:
__fastcall TMarkupParser(TComponent* Owner);
void __fastcall ParseElements(TMemoryStream *ms);
__published:
__property int NumberOfElements = {read=FNumberOfElements};
__property bool RemoveCRLF = {read=FRemoveCRLF, write=SetRemoveCRLF, default=false};
__property TMarkupNotifyEvent OnMarkupElement = {read=FOnMarkupElement,write=FOnMarkupElement};
};
//---------------------------------------------------------------------------
#endif