update dev300-m58
[ooovba.git] / soltools / inc / st_gilrw.hxx
blobe0f60638dfcffc6982a447e336323300adc7f1fb
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: st_gilrw.hxx,v $
10 * $Revision: 1.3 $
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 SOLTOOLS_ST_GILRW_HXX
32 #define SOLTOOLS_ST_GILRW_HXX
35 #include "gilacces.hxx"
36 #include "st_list.hxx"
38 class Simstr;
39 class List_GenericInfo;
40 class GenericInfo;
41 class GenericInfo_Parser;
43 class ST_InfoListReader : public GenericInfoParseTypes,
44 private GenericInfoList_Builder
46 public:
47 // LIFECYCLE
48 ST_InfoListReader();
49 ~ST_InfoListReader();
50 // OPERATIONS
51 bool LoadList(
52 List_GenericInfo & o_rList,
53 const Simstr & i_sFileName );
54 // INFO
55 E_Error GetLastError(
56 UINT32 * o_pErrorLine = 0 ) const;
57 private:
58 // Interface GenericInfoList_Builder
59 virtual void AddKey(
60 const char * i_sKey,
61 UINT32 i_nKeyLength,
62 const char * i_sValue,
63 UINT32 i_nValueLength,
64 const char * i_sComment,
65 UINT32 i_nCommentLength );
67 virtual void OpenList();
68 virtual void CloseList();
70 // Forbid copies:
71 ST_InfoListReader( const ST_InfoListReader & );
72 ST_InfoListReader & operator=( const ST_InfoListReader & );
74 // DATA
75 GenericInfo_Parser *
76 dpParser;
78 ST_List< List_GenericInfo * >
79 aListStack;
80 GenericInfo * pCurKey;
83 class ST_InfoListWriter : public GenericInfoParseTypes,
84 private GenericInfoList_Browser
86 public:
87 // LIFECYCLE
88 ST_InfoListWriter();
89 ~ST_InfoListWriter();
90 // OPERATIONS
91 bool SaveList(
92 const Simstr & i_sFileName,
93 List_GenericInfo & io_rList );
95 // INFO
96 E_Error GetLastError() const;
98 private:
99 // Interface GenericInfoList_Browser
100 virtual bool Start_CurList();
101 virtual bool NextOf_CurList();
103 virtual void Get_CurKey(
104 char * o_rKey ) const;
105 virtual void Get_CurValue(
106 char * o_rValue ) const;
107 virtual void Get_CurComment(
108 char * o_rComment ) const;
109 virtual bool HasSubList_CurKey() const;
111 virtual void Push_CurList();
112 virtual void Pop_CurList();
114 // Forbid copies:
115 ST_InfoListWriter( const ST_InfoListWriter & );
116 ST_InfoListWriter & operator=( const ST_InfoListWriter & );
118 // DATA
119 GenericInfo_Parser *
120 dpParser;
122 ST_List< List_GenericInfo * >
123 aListStack;
124 GenericInfo * pCurKey;
127 #endif