1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: parseinc.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef ADC_PARSEINC_HXX
32 #define ADC_PARSEINC_HXX
35 #include <tools/tkpchars.hxx>
38 jumpOver( CharacterSource
& io_rText
,
42 for ( cNext
= io_rText
.CurChar();
44 cNext
= io_rText
.MoveOn() )
51 jumpTo( CharacterSource
& io_rText
,
55 for ( cNext
= io_rText
.CurChar();
56 cNext
!= in_c AND cNext
!= 0;
57 cNext
= io_rText
.MoveOn() )
64 jumpTo( CharacterSource
& io_rText
,
69 for ( cNext
= io_rText
.CurChar();
70 cNext
!= in_c1 AND cNext
!= in_c2 AND cNext
!= 0;
71 cNext
= io_rText
.MoveOn() )
78 jumpTo( CharacterSource
& io_rText
,
84 for ( cNext
= io_rText
.CurChar();
85 cNext
!= in_c1 AND cNext
!= in_c2 AND cNext
!= in_c3 AND cNext
!= 0;
86 cNext
= io_rText
.MoveOn() )
93 jumpTo( CharacterSource
& io_rText
,
100 for ( cNext
= io_rText
.CurChar();
101 cNext
!= in_c1 AND cNext
!= in_c2 AND cNext
!= in_c3
102 AND cNext
!= in_c4 AND cNext
!= 0;
103 cNext
= io_rText
.MoveOn() )
110 jumpOverWhite(CharacterSource
& io_rText
)
113 for ( cNext
= io_rText
.CurChar();
114 static_cast<UINT8
>(cNext
) < 33
115 AND cNext
!= 0 AND cNext
!= 13 AND cNext
!= 10;
116 cNext
= io_rText
.MoveOn() )
123 jumpToWhite(CharacterSource
& io_rText
)
126 for ( cNext
= io_rText
.CurChar();
127 static_cast<UINT8
>(cNext
) > 32;
128 cNext
= io_rText
.MoveOn() )
135 jumpToEol(CharacterSource
& io_rText
, int & o_rCount_BackslashedLineBreaks
)
137 o_rCount_BackslashedLineBreaks
= 0;
139 for ( cNext
= io_rText
.CurChar();
140 cNext
!= 13 AND cNext
!= 10 AND cNext
!= NULCH
;
141 cNext
= io_rText
.MoveOn() )
145 cNext
= io_rText
.MoveOn();
149 ++o_rCount_BackslashedLineBreaks
;
156 jumpToEol(CharacterSource
& io_rText
)
159 for ( cNext
= io_rText
.CurChar();
160 cNext
!= 13 AND cNext
!= 10 AND cNext
!= NULCH
;
161 cNext
= io_rText
.MoveOn() )
170 jumpOverEol(CharacterSource
& io_rText
)
172 char cNext
= io_rText
.CurChar();
182 inline char // Finds a matching closing bracket after the opening one is passed
183 jumpToMatchingBracket( CharacterSource
& io_rText
,
189 for ( cNext
= io_rText
.CurChar();
190 nCounter
- (cNext
== in_cEnd
? 1 : 0) > 0 AND cNext
!= NULCH
;
191 cNext
= io_rText
.MoveOn() )
193 if (cNext
== in_cEnd
)
195 else if (cNext
== in_cBegin
)