merged tag ooo/DEV300_m102
[LibreOffice.git] / l10ntools / inc / lngmerge.hxx
blobdce939386539fe569402ae720876ccbbcdc72da7
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 // local includes
28 #include "export.hxx"
30 DECLARE_LIST( LngLineList, ByteString * )
32 #define LNG_OK 0x0000
33 #define LNG_FILE_NOTFOUND 0x0001
34 #define LNG_COULD_NOT_OPEN 0x0002
35 #define SDF_OK 0x0003
36 #define SDF_FILE_NOTFOUND 0x0004
37 #define SDF_COULD_NOT_OPEN 0x0005
40 // class LngParser
43 class LngParser
45 private:
46 sal_uInt16 nError;
47 LngLineList *pLines;
48 ByteString sSource;
49 sal_Bool bDBIsUTF8;
50 sal_Bool bULF;
51 bool bQuiet;
52 std::vector<ByteString> aLanguages;
54 void FillInFallbacks( ByteStringHashMap Text );
55 bool isNextGroup( ByteString &sGroup_out , ByteString &sLine_in);
56 void ReadLine( const ByteString &sLine_in , ByteStringHashMap &rText_inout );
57 void WriteSDF( SvFileStream &aSDFStream , ByteStringHashMap &rText_inout ,
58 const ByteString &rPrj ,
59 const ByteString &rRoot , const ByteString &sActFileName , const ByteString &sID );
60 public:
61 LngParser( const ByteString &rLngFile, sal_Bool bUTF8, sal_Bool bULFFormat );
62 ~LngParser();
64 sal_Bool CreateSDF( const ByteString &rSDFFile, const ByteString &rPrj, const ByteString &rRoot );
65 sal_Bool Merge( const ByteString &rSDFFile, const ByteString &rDestinationFile , const ByteString &rPrj );