-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathignoredestination.cpp
More file actions
executable file
·59 lines (53 loc) · 1.41 KB
/
ignoredestination.cpp
File metadata and controls
executable file
·59 lines (53 loc) · 1.41 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*Copyright 2001
*
* ignoredestination.cpp
*
* Author: Gregory Ford greg@reddfish.co.nz
* RTF token parser based on:
* rtf2html by Dmitry Porapov <dpotapov@capitalsoft.com>,
* based on earlier work of Chuck Shotton.
* distributed under BSD-style license
* RTF token lists and hashing algorithm based on
* RTF Tools, Release 1.10
* 6 April 1994
* Paul DuBois dubois@primate.wisc.edu
*
* Copying permitted under GNU licence (see COPYING)
*/
// ignoredestination.cpp: implementation of the IgnoreDestination class.
//
//////////////////////////////////////////////////////////////////////
#include <string>
using namespace std;
#include "token.h"
#include "charsource.h"
#include "tokeniser.h"
#include "destination.h"
#include "ignoredestination.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
IgnoreDestination::IgnoreDestination()
{
groupLevel = 0 ;
}
IgnoreDestination::~IgnoreDestination()
{
}
bool IgnoreDestination::handleToken( Token* token)
{
if ( token->getType() == groupToken ) {
GroupToken *g = (GroupToken *)token;
if ( g->group == startGroup ) {
groupLevel++;
} else {
groupLevel--;
}
if (groupLevel <0) {
groupLevel = 0; // reinitialise this object
// ready for reusing on another group!
return true;
}
}
return false;
}