Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #ifndef _RSCRSC_HXX
20 : #define _RSCRSC_HXX
21 :
22 : #include <rscall.h>
23 : #include <rscerror.h>
24 : #include <rsctools.hxx>
25 :
26 : #include <list>
27 :
28 : class RscTypCont;
29 : class DirEntry;
30 :
31 : /****************** T Y P E S ********************************************/
32 :
33 : #define MAX_INPUTFILES 100
34 : #define MAX_SYMBOLS 10
35 : #define MAX_INCLUDES 10
36 :
37 : /****************** R s c C m d L i n e **********************************/
38 : class RscCmdLine
39 : {
40 : void Init();
41 :
42 : public:
43 :
44 : RscStrList aInputList; // Liste der Quelldateien
45 : rtl::OString aPath; // Liste der Pfade
46 : RSCBYTEORDER_TYPE nByteOrder;
47 : unsigned short nCommands; // Steuerbits
48 : rtl::OString aOutputLst; // Name der List-Ausgabedatei
49 : rtl::OString aOutputSrs; // Name der Srs-Ausgabedatei
50 : rtl::OString aOutputSrc; // Name der Src-Ausgabedatei
51 : rtl::OString aOutputRcCtor; // Name der Ctor-Ausgabedatei
52 : rtl::OString aOutputCxx; // Name der Cxx-Ausgabedatei
53 : rtl::OString aOutputHxx; // Name der Hxx-Ausgabedatei
54 : rtl::OString aTouchFile; // create this file when done in rsc2
55 : rtl::OString aILDir;
56 :
57 2073 : struct OutputFile
58 : {
59 : rtl::OString aLangName; // language name
60 : rtl::OString aOutputRc; // target file
61 : rtl::OString aLangSearchPath; // language specific search path
62 : ::std::list< rtl::OString > aSysSearchDirs; // paths to search for images
63 :
64 691 : OutputFile() {}
65 : };
66 :
67 : std::list<OutputFile> m_aOutputFiles;
68 : std::list< std::pair< rtl::OString, rtl::OString > > m_aReplacements;
69 :
70 : RscCmdLine( int argc, char ** argv, RscError * pEH );
71 : ~RscCmdLine();
72 :
73 : ::rtl::OString substitutePaths( const ::rtl::OString& rIn );
74 : };
75 : /****************** R s c ************************************************/
76 :
77 : struct WriteRcContext;
78 :
79 : class RscCompiler
80 : {
81 : private:
82 : rtl::OString aTmpOutputHxx; // Name der TempHxx-Ausgabedatei
83 : rtl::OString aTmpOutputCxx; // Name der TempCxx-Ausgabedatei
84 : rtl::OString aTmpOutputRcCtor; // Name der Temp Ctor-Ausgabedatei
85 : rtl::OString aTmpOutputSrc; // Name der TempSrc-Ausgabedatei
86 :
87 : void CreateResFile( const char * pRc );
88 : void Append( const rtl::OString& rOutputSrs, const rtl::OString& rTmpFile );
89 :
90 : bool GetImageFilePath( const RscCmdLine::OutputFile& rOutputFile,
91 : const WriteRcContext& rContext,
92 : const rtl::OString& rBaseFileName,
93 : rtl::OString& rImagePath,
94 : FILE* pSysListFile );
95 : void PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile,
96 : const WriteRcContext& rContext,
97 : const DirEntry& rSrsInPath,
98 : const DirEntry& rSrsOutPath );
99 :
100 : public:
101 : RscTypCont* pTC; // String und Id-Verwalter
102 : RscCmdLine* pCL; // Kommandozeile
103 : FILE * fListing; // Ausgabedatei fuer Listings
104 : FILE * fExitFile; // bei Abbruch muss diese Datei geschlossen werden
105 :
106 : RscCompiler( RscCmdLine *, RscTypCont * );
107 : ~RscCompiler();
108 :
109 : ERRTYPE Start();
110 :
111 : // Include Statements lesen
112 : ERRTYPE IncludeParser( sal_uLong lFileKey );
113 : ERRTYPE ParseOneFile( sal_uLong lFileKey, const RscCmdLine::OutputFile* pOutputFile, const WriteRcContext* pContext );
114 : ERRTYPE Link();
115 : void EndCompile();
116 : };
117 :
118 : #endif //_RSCRSC_HXX
119 :
120 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|