merged tag ooo/DEV300_m102
[LibreOffice.git] / rsc / inc / rscrsc.hxx
blob711b686f8a274d9caace66839eeb1a62719f0f10
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef _RSCRSC_HXX
28 #define _RSCRSC_HXX
30 #ifndef RSCALL_H
31 #include <rscall.h>
32 #endif
33 #ifndef RSCERROR_H
34 #include <rscerror.h>
35 #endif
36 #ifndef RSCTOOLS_HXX
37 #include <rsctools.hxx>
38 #endif
40 #include <list>
42 class RscTypCont;
43 class DirEntry;
45 /****************** T Y P E S ********************************************/
47 #define MAX_INPUTFILES 100
48 #define MAX_SYMBOLS 10
49 #define MAX_INCLUDES 10
51 /****************** R s c C m d L i n e **********************************/
52 class RscCmdLine
54 void Init();
56 public:
58 RscStrList aInputList; // Liste der Quelldateien
59 RscStrList aSymbolList; // Liste der Symbole
60 ByteString aPath; // Liste der Pfade
61 RSCBYTEORDER_TYPE nByteOrder;
62 unsigned short nCommands; // Steuerbits
63 ByteString aOutputLst; // Name der List-Ausgabedatei
64 ByteString aOutputSrs; // Name der Srs-Ausgabedatei
65 ByteString aOutputSrc; // Name der Src-Ausgabedatei
66 ByteString aOutputRcCtor; // Name der Ctor-Ausgabedatei
67 ByteString aOutputCxx; // Name der Cxx-Ausgabedatei
68 ByteString aOutputHxx; // Name der Hxx-Ausgabedatei
69 ByteString aTouchFile; // create this file when done in rsc2
70 ByteString aILDir;
72 struct OutputFile
74 ByteString aLangName; // language name
75 ByteString aOutputRc; // target file
76 ByteString aLangSearchPath; // language specific search path
77 ::std::list< ByteString > aSysSearchDirs; // pathes to search for images
79 OutputFile() {}
82 std::list<OutputFile> m_aOutputFiles;
83 std::list< std::pair< rtl::OString, rtl::OString > > m_aReplacements;
85 RscCmdLine( int argc, char ** argv, RscError * pEH );
86 RscCmdLine();
88 ~RscCmdLine();
90 ::rtl::OString substitutePaths( const ::rtl::OString& rIn );
92 /****************** R s c ************************************************/
94 struct WriteRcContext;
96 class RscCompiler
98 private:
99 RscStrList aTmpFileList; // Liste der Tmp-Dateien
100 ByteString aTmpOutputHxx; // Name der TempHxx-Ausgabedatei
101 ByteString aTmpOutputCxx; // Name der TempCxx-Ausgabedatei
102 ByteString aTmpOutputRcCtor; // Name der Temp Ctor-Ausgabedatei
103 ByteString aTmpOutputSrc; // Name der TempSrc-Ausgabedatei
105 void CreateResFile( const char * pRc );
106 void Append( const ByteString& rOutputSrs, const ByteString& rTmpFile );
107 void OpenInput( const ByteString& rInput );
109 bool GetImageFilePath( const RscCmdLine::OutputFile& rOutputFile,
110 const WriteRcContext& rContext,
111 const ByteString& rBaseFileName,
112 ByteString& rImagePath,
113 FILE* pSysListFile );
114 void PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile,
115 const WriteRcContext& rContext,
116 const DirEntry& rSrsInPath,
117 const DirEntry& rSrsOutPath );
119 public:
120 RscTypCont* pTC; // String und Id-Verwalter
121 RscCmdLine* pCL; // Kommandozeile
122 FILE * fListing; // Ausgabedatei fuer Listings
123 FILE * fExitFile; // bei Abbruch muss diese Datei geschlossen werden
125 RscCompiler( RscCmdLine *, RscTypCont * );
126 ~RscCompiler();
128 ERRTYPE Start();
129 ByteString GetTmpFileName(); // Die Dateien werden geloescht
131 // Include Statements lesen
132 ERRTYPE IncludeParser( sal_uLong lFileKey );
133 ERRTYPE ParseOneFile( sal_uLong lFileKey, const RscCmdLine::OutputFile* pOutputFile, const WriteRcContext* pContext );
134 ERRTYPE Link();
135 void EndCompile();
138 #endif //_RSCRSC_HXX