Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / rsc / inc / rscpar.hxx
blob0833e224fb6fa0ae0a5ebb0cca378c7d681422b4
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef _RSCPAR_HXX
20 #define _RSCPAR_HXX
22 #include <rsctools.hxx>
23 #include <rscerror.h>
25 /****************** C L A S S E S ****************************************/
26 class RscTypCont;
27 /*********** R s c F i l e I n s t ***************************************/
29 #define READBUFFER_MAX 256
30 class RscFileInst
32 ERRTYPE aFirstError;// Erster Fehler
33 sal_uInt32 nErrorLine; // Zeile des ersten Fehlers
34 sal_uInt32 nErrorPos; // Position des ersten Fehlers
35 sal_uInt32 nLineNo; // Zeile in der Eingabedatei
36 sal_uLong lFileIndex; // Index auf Eingabedatei
37 sal_uLong lSrcIndex; // Index auf Basisdatei
38 FILE * fInputFile; // Eingabedatei
39 char * pInput; // Lesepuffer
40 sal_uInt32 nInputBufLen; // Laenge des Lesepuffers
41 sal_uInt32 nInputPos; // Position im Lesepuffer
42 sal_uInt32 nInputEndPos;// Ende im Lesepuffer
43 char * pLine; // Zeile
44 sal_uInt32 nLineBufLen;//Lange des Zeilenpuffres
45 sal_uInt32 nScanPos; // Position in der Zeile
46 int cLastChar;
47 sal_Bool bEof;
49 public:
50 RscTypCont * pTypCont;
51 void Init(); // ctor initialisieren
52 RscFileInst( RscTypCont * pTC, sal_uLong lIndexSrc,
53 sal_uLong lFileIndex, FILE * fFile );
54 ~RscFileInst();
55 sal_Bool IsEof() const { return bEof; }
56 void SetFileIndex( sal_uLong lFIndex ) { lFileIndex = lFIndex; }
57 sal_uLong GetFileIndex() { return( lFileIndex ); }
58 sal_uLong GetSrcIndex() { return( lSrcIndex ); }
59 void SetLineNo( sal_uInt32 nLine ) { nLineNo = nLine; }
60 sal_uInt32 GetLineNo() { return( nLineNo ); }
61 sal_uInt32 GetScanPos() { return( nScanPos ); }
62 char * GetLine() { return( pLine ); }
63 int GetChar();
64 int GetFastChar() { return pLine[ nScanPos ] ?
65 pLine[ nScanPos++ ] : GetChar();
67 void GetNewLine();
68 // Fehlerbehandlung
69 void SetError( ERRTYPE aError );
70 ERRTYPE GetError() { return aFirstError; }
71 sal_uInt32 GetErrorLine() { return nErrorLine; }
72 sal_uInt32 GetErrorPos() { return nErrorPos; }
75 /******************* F u n c t i o n *************************************/
76 void IncludeParser( RscFileInst * pFileInst );
77 ERRTYPE parser( RscFileInst * pFileInst );
79 #endif // _RSCPAR_HXX
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */