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 :
30 : /****************** T Y P E S ********************************************/
31 :
32 : #define MAX_INPUTFILES 100
33 : #define MAX_SYMBOLS 10
34 : #define MAX_INCLUDES 10
35 :
36 : /****************** R s c C m d L i n e **********************************/
37 : class RscCmdLine
38 : {
39 : void Init();
40 :
41 : public:
42 :
43 : RscStrList aInputList; // Liste der Quelldateien
44 : OString aPath; // Liste der Pfade
45 : RSCBYTEORDER_TYPE nByteOrder;
46 : unsigned short nCommands; // Steuerbits
47 : OString aOutputSrs; // Name der Srs-Ausgabedatei
48 : OString aILDir;
49 :
50 1878 : struct OutputFile
51 : {
52 : OString aLangName; // language name
53 : OString aOutputRc; // target file
54 : OString aLangSearchPath; // language specific search path
55 : ::std::list< OString > aSysSearchDirs; // paths to search for images
56 :
57 626 : OutputFile() {}
58 : };
59 :
60 : std::list<OutputFile> m_aOutputFiles;
61 : std::list< std::pair< OString, OString > > m_aReplacements;
62 :
63 : RscCmdLine( int argc, char ** argv, RscError * pEH );
64 : ~RscCmdLine();
65 :
66 : OString substitutePaths( const OString& rIn );
67 : };
68 : /****************** R s c ************************************************/
69 :
70 : struct WriteRcContext;
71 :
72 : class RscCompiler
73 : {
74 : private:
75 : void CreateResFile( const char * pRc );
76 : void Append( const OString& rOutputSrs, const OString& rTmpFile );
77 :
78 : bool GetImageFilePath( const RscCmdLine::OutputFile& rOutputFile,
79 : const WriteRcContext& rContext,
80 : const OString& rBaseFileName,
81 : OString& rImagePath,
82 : FILE* pSysListFile );
83 : void PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile,
84 : const WriteRcContext& rContext,
85 : const OUString& rSrsInPath,
86 : const OUString& rSrsOutPath );
87 :
88 : public:
89 : RscTypCont* pTC; // String und Id-Verwalter
90 : RscCmdLine* pCL; // Kommandozeile
91 : FILE * fListing; // Ausgabedatei fuer Listings
92 : FILE * fExitFile; // bei Abbruch muss diese Datei geschlossen werden
93 :
94 : RscCompiler( RscCmdLine *, RscTypCont * );
95 : ~RscCompiler();
96 :
97 : ERRTYPE Start();
98 :
99 : // Include Statements lesen
100 : ERRTYPE IncludeParser( sal_uLong lFileKey );
101 : ERRTYPE ParseOneFile( sal_uLong lFileKey, const RscCmdLine::OutputFile* pOutputFile, const WriteRcContext* pContext );
102 : ERRTYPE Link();
103 : void EndCompile();
104 : };
105 :
106 : #endif //_RSCRSC_HXX
107 :
108 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|