1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: rscrsc.hxx,v $
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 ************************************************************************/
40 #include <rsctools.hxx>
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 **********************************/
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
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
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
);
93 ::rtl::OString
substitutePaths( const ::rtl::OString
& rIn
);
95 /****************** R s c ************************************************/
97 struct WriteRcContext
;
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
);
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
* );
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
);