update dev300-m58
[ooovba.git] / rsc / inc / rscrsc.hxx
blobe2211a9aeed55e1c6bb1d89c61dd852a72d61d9e
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: rscrsc.hxx,v $
10 * $Revision: 1.13 $
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 ************************************************************************/
30 #ifndef _RSCRSC_HXX
31 #define _RSCRSC_HXX
33 #ifndef RSCALL_H
34 #include <rscall.h>
35 #endif
36 #ifndef RSCERROR_H
37 #include <rscerror.h>
38 #endif
39 #ifndef RSCTOOLS_HXX
40 #include <rsctools.hxx>
41 #endif
43 #include <list>
45 class RscTypCont;
46 class DirEntry;
48 /****************** T Y P E S ********************************************/
50 #define MAX_INPUTFILES 100
51 #define MAX_SYMBOLS 10
52 #define MAX_INCLUDES 10
54 /****************** R s c C m d L i n e **********************************/
55 class RscCmdLine
57 void Init();
59 public:
61 RscStrList aInputList; // Liste der Quelldateien
62 RscStrList aSymbolList; // Liste der Symbole
63 ByteString aPath; // Liste der Pfade
64 RSCBYTEORDER_TYPE nByteOrder;
65 unsigned short nCommands; // Steuerbits
66 ByteString aOutputLst; // Name der List-Ausgabedatei
67 ByteString aOutputSrs; // Name der Srs-Ausgabedatei
68 ByteString aOutputSrc; // Name der Src-Ausgabedatei
69 ByteString aOutputRcCtor; // Name der Ctor-Ausgabedatei
70 ByteString aOutputCxx; // Name der Cxx-Ausgabedatei
71 ByteString aOutputHxx; // Name der Hxx-Ausgabedatei
72 ByteString aTouchFile; // create this file when done in rsc2
73 ByteString aILDir;
75 struct OutputFile
77 ByteString aLangName; // language name
78 ByteString aOutputRc; // target file
79 ByteString aLangSearchPath; // language specific search path
80 ::std::list< ByteString > aSysSearchDirs; // pathes to search for images
82 OutputFile() {}
85 std::list<OutputFile> m_aOutputFiles;
86 std::list< std::pair< rtl::OString, rtl::OString > > m_aReplacements;
88 RscCmdLine( int argc, char ** argv, RscError * pEH );
89 RscCmdLine();
91 ~RscCmdLine();
93 ::rtl::OString substitutePaths( const ::rtl::OString& rIn );
95 /****************** R s c ************************************************/
97 struct WriteRcContext;
99 class RscCompiler
101 private:
102 RscStrList aTmpFileList; // Liste der Tmp-Dateien
103 ByteString aTmpOutputHxx; // Name der TempHxx-Ausgabedatei
104 ByteString aTmpOutputCxx; // Name der TempCxx-Ausgabedatei
105 ByteString aTmpOutputRcCtor; // Name der Temp Ctor-Ausgabedatei
106 ByteString aTmpOutputSrc; // Name der TempSrc-Ausgabedatei
108 void CreateResFile( const char * pRc );
109 void Append( const ByteString& rOutputSrs, const ByteString& rTmpFile );
110 void OpenInput( const ByteString& rInput );
112 bool GetImageFilePath( const RscCmdLine::OutputFile& rOutputFile,
113 const WriteRcContext& rContext,
114 const ByteString& rBaseFileName,
115 ByteString& rImagePath,
116 FILE* pSysListFile );
117 void PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile,
118 const WriteRcContext& rContext,
119 const DirEntry& rSrsInPath,
120 const DirEntry& rSrsOutPath );
122 public:
123 RscTypCont* pTC; // String und Id-Verwalter
124 RscCmdLine* pCL; // Kommandozeile
125 FILE * fListing; // Ausgabedatei fuer Listings
126 FILE * fExitFile; // bei Abbruch muss diese Datei geschlossen werden
128 RscCompiler( RscCmdLine *, RscTypCont * );
129 ~RscCompiler();
131 ERRTYPE Start();
132 ByteString GetTmpFileName(); // Die Dateien werden geloescht
134 // Include Statements lesen
135 ERRTYPE IncludeParser( ULONG lFileKey );
136 ERRTYPE ParseOneFile( ULONG lFileKey, const RscCmdLine::OutputFile* pOutputFile, const WriteRcContext* pContext );
137 ERRTYPE Link();
138 void EndCompile();
141 #endif //_RSCRSC_HXX