Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / rsc / inc / rscrsc.hxx
blob42c19984b46f914b4e9af8498a2cbd2e5adf8102
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef _RSCRSC_HXX
20 #define _RSCRSC_HXX
22 #include <rscall.h>
23 #include <rscerror.h>
24 #include <rsctools.hxx>
26 #include <list>
28 class RscTypCont;
29 class DirEntry;
31 /****************** T Y P E S ********************************************/
33 #define MAX_INPUTFILES 100
34 #define MAX_SYMBOLS 10
35 #define MAX_INCLUDES 10
37 /****************** R s c C m d L i n e **********************************/
38 class RscCmdLine
40 void Init();
42 public:
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;
57 struct OutputFile
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
64 OutputFile() {}
67 std::list<OutputFile> m_aOutputFiles;
68 std::list< std::pair< rtl::OString, rtl::OString > > m_aReplacements;
70 RscCmdLine( int argc, char ** argv, RscError * pEH );
71 ~RscCmdLine();
73 ::rtl::OString substitutePaths( const ::rtl::OString& rIn );
75 /****************** R s c ************************************************/
77 struct WriteRcContext;
79 class RscCompiler
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
87 void CreateResFile( const char * pRc );
88 void Append( const rtl::OString& rOutputSrs, const rtl::OString& rTmpFile );
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 );
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
106 RscCompiler( RscCmdLine *, RscTypCont * );
107 ~RscCompiler();
109 ERRTYPE Start();
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();
118 #endif //_RSCRSC_HXX
120 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */