1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
28 #ifndef SOLTOOLS_GI_PARSE_HXX
29 #define SOLTOOLS_GI_PARSE_HXX
32 #include "gilacces.hxx"
35 class GenericInfoList_Builder
;
36 class GenericInfoList_Browser
;
38 /** Reads generic information files into a simple structure in memory.
40 Information files used by this parser have the following format:
59 class GenericInfo_Parser
: public GenericInfoParseTypes
62 typedef unsigned long UINT32
;
66 ~GenericInfo_Parser();
68 /** reads a information file and stores the data in a
72 GenericInfoList_Builder
&
74 const Simstr
& i_sSourceFileName
);
76 /** save the InformationList to rSourceFile
77 returns false on error
80 const Simstr
& i_rOutputFile
,
81 GenericInfoList_Browser
&
85 UINT32
* o_pErrorLine
= 0 ) const;
100 GenericInfoList_Builder
&
103 GenericInfoList_Browser
&
107 bool InterpretLine();
108 E_LineType
ClassifyLine();
111 void PushLevel_Read(); /// When list is opened by '{':
112 void PopLevel_Read(); /// When list is closed by '}':
113 void AddCurLine2CurComment();
116 std::ostream
& o_rFile
);
118 void PushLevel_Write(); /// When SubList is pushed in pResource
119 void PopLevel_Write(); /// When SubList is popped in pResource
122 std::ostream
& o_rFile
,
123 const char * i_sStr
);
125 std::ostream
& o_rFile
,
126 const char * i_sStr
);
128 std::ostream
& o_rFile
,
129 const char * i_sStr
);
130 void WriteIndentation(
131 std::ostream
& o_rFile
);
134 const char * sCurParsePosition
;
145 GenericInfoList_Builder
*
147 GenericInfoList_Browser
*
155 inline GenericInfo_Parser::E_Error
156 GenericInfo_Parser::GetLastError( UINT32
* o_pErrorLine
) const
158 if ( o_pErrorLine
!= 0 )
159 *o_pErrorLine
= nErrorLine
;
167 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */