1 //========================================================================
2 //
3 // PSTokenizer.h
4 //
5 // Copyright 2002-2003 Glyph & Cog, LLC
6 //
7 //========================================================================
8 
9 //========================================================================
10 //
11 // Modified under the Poppler project - http://poppler.freedesktop.org
12 //
13 // All changes made under the Poppler project to this file are licensed
14 // under GPL version 2 or later
15 //
16 // Copyright (C) 2006 Scott Turner <scotty1024@mac.com>
17 //
18 // To see a description of the changes please see the Changelog file that
19 // came with your tarball or type make ChangeLog if you are building from git
20 //
21 //========================================================================
22 
23 #ifndef PSTOKENIZER_H
24 #define PSTOKENIZER_H
25 
26 //------------------------------------------------------------------------
27 
28 class PSTokenizer
29 {
30 public:
31     PSTokenizer(int (*getCharFuncA)(void *), void *dataA);
32     ~PSTokenizer();
33 
34     // Get the next PostScript token.  Returns false at end-of-stream.
35     bool getToken(char *buf, int size, int *length);
36 
37 private:
38     int lookChar();
39     void consumeChar();
40     int getChar();
41 
42     int (*getCharFunc)(void *);
43     void *data;
44     int charBuf;
45 };
46 
47 #endif
48