rtfimport_tokenizer.h
1/*
2 This file is part of the KDE project
3 Copyright (C) 2001 Ewald Snel <ewald@rambo.its.tudelft.nl>
4 Copyright (C) 2001 Tomasz Grobelny <grotk@poczta.onet.pl>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10*/
11
12#ifndef __RTFIMPORT_TOKENIZER_H__
13#define __RTFIMPORT_TOKENIZER_H__
14
15#include <tqcstring.h>
16#include <tqfile.h>
17
18
21{
22public:
23 enum TokenType { OpenGroup, CloseGroup, ControlWord, PlainText, BinaryData };
24
26
31 void open( TQFile *in );
35 void next();
36
37 // token data
38
40 char *text;
41 TokenType type;
43 int value;
46
47public:
49 TQByteArray binaryData;
50
51 // tokenizer (private) data
52private:
53 int nextChar();
54
55 TQFile *infile;
56 TQByteArray fileBuffer;
57 TQCString tokenText;
58 uchar *fileBufferPtr;
59 uchar *fileBufferEnd;
60};
61
62#endif
This class represents the tokenizer and the token.
void open(TQFile *in)
Open tokenizer from file.
void next()
Reads the next token.
TQByteArray binaryData
Binary data (of \bin keyword)
char * text
plain text or control word/symbol
int value
numeric parameter
bool hasParam
token has a (numeric) parameter