StarEncoding.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
2
3/* libstaroffice
4* Version: MPL 2.0 / LGPLv2+
5*
6* The contents of this file are subject to the Mozilla Public License Version
7* 2.0 (the "License"); you may not use this file except in compliance with
8* the License or as specified alternatively below. You may obtain a copy of
9* the License at http://www.mozilla.org/MPL/
10*
11* Software distributed under the License is distributed on an "AS IS" basis,
12* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13* for the specific language governing rights and limitations under the
14* License.
15*
16* Major Contributor(s):
17* Copyright (C) 2002 William Lachance (wrlach@gmail.com)
18* Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
19* Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
20* Copyright (C) 2006, 2007 Andrew Ziem
21* Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
22*
23*
24* All Rights Reserved.
25*
26* For minor contributions see the git repository.
27*
28* Alternatively, the contents of this file may be used under the terms of
29* the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
30* in which case the provisions of the LGPLv2+ are applicable
31* instead of those above.
32*/
33
34/*
35 * StarEncoding to read/parse some basic encoding in StarOffice documents
36 *
37 */
38#ifndef STAR_ENCODING
39# define STAR_ENCODING
40
41#include <vector>
42
44
51{
52public:
54 enum Encoding {
60 // 40
61 E_MS_1258,/*E_APPLE_ARABIC,*/E_APPLE_CENTEURO=42,E_APPLE_CROATIAN,E_APPLE_CYRILLIC,/*E_APPLE_DEVANAGARI,E_APPLE_FARSI,*/E_APPLE_GREEK=47,
62 /*E_APPLE_GUJARATI,E_APPLE_GURMUKHI,E_APPLE_HEBREW,*/E_APPLE_ICELAND=51,E_APPLE_ROMANIAN,/*E_APPLE_THAI,*/E_APPLE_TURKISH=54,E_APPLE_UKRAINIAN,
65 /*E_ISO_2022_JP,E_ISO_2022_CN,*/E_KOI8_R=74,E_UTF7,E_UTF8,E_ISO_8859_10,E_ISO_8859_13,E_EUC_KR,
66 // 80
67 /*E_ISO_2022_KR,*/E_JIS_X_0201=81,E_JIS_X_0208,E_JIS_X_0212,E_MS_1361,/*E_GB_18030,*/E_BIG5_HKSCS=86,E_TIS_620,
69
70 // E_USER_START=0x8000,E_USER_END=0xEFFF,
71
72 E_UCS4=0xFFFE,E_UCS2=0xFFFF
73 };
74
78 virtual ~StarEncoding();
79
81 static Encoding getEncodingForId(int id);
83 static bool convert(std::vector<uint8_t> const &src, Encoding encoding, std::vector<uint32_t> &dest, std::vector<size_t> &srcPositions);
84
85protected:
91 static bool read(std::vector<uint8_t> const &src, size_t &pos, Encoding encoding, std::vector<uint32_t> &dest);
92};
93#endif
94// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
the main class to read/.
Definition: StarEncoding.hxx:51
Encoding
the different encoding
Definition: StarEncoding.hxx:54
@ E_IBM_855
Definition: StarEncoding.hxx:58
@ E_APPLE_ROMANIAN
Definition: StarEncoding.hxx:62
@ E_GB_2312
Definition: StarEncoding.hxx:64
@ E_APPLE_ICELAND
Definition: StarEncoding.hxx:62
@ E_ISO_8859_5
Definition: StarEncoding.hxx:57
@ E_GBK
Definition: StarEncoding.hxx:64
@ E_DONTKNOW
Definition: StarEncoding.hxx:55
@ E_ISO_8859_8
Definition: StarEncoding.hxx:57
@ E_MS_936
Definition: StarEncoding.hxx:63
@ E_MS_1253
Definition: StarEncoding.hxx:59
@ E_SHIFT_JIS
Definition: StarEncoding.hxx:64
@ E_UTF8
Definition: StarEncoding.hxx:65
@ E_ISO_8859_13
Definition: StarEncoding.hxx:65
@ E_TIS_620
Definition: StarEncoding.hxx:67
@ E_APPLE_ROMAN
Definition: StarEncoding.hxx:55
@ E_EUC_CN
Definition: StarEncoding.hxx:64
@ E_APPLE_TURKISH
Definition: StarEncoding.hxx:62
@ E_MS_1258
Definition: StarEncoding.hxx:61
@ E_ISCII_DEVANAGARI
Definition: StarEncoding.hxx:68
@ E_APPLE_KOREAN
Definition: StarEncoding.hxx:63
@ E_MS_1255
Definition: StarEncoding.hxx:59
@ E_ISO_8859_4
Definition: StarEncoding.hxx:56
@ E_JIS_X_0201
Definition: StarEncoding.hxx:67
@ E_ISO_8859_9
Definition: StarEncoding.hxx:57
@ E_APPLE_JAPANESE
Definition: StarEncoding.hxx:63
@ E_MS_1257
Definition: StarEncoding.hxx:59
@ E_APPLE_UKRAINIAN
Definition: StarEncoding.hxx:62
@ E_IBM_864
Definition: StarEncoding.hxx:58
@ E_MS_949
Definition: StarEncoding.hxx:63
@ E_ISO_8859_6
Definition: StarEncoding.hxx:57
@ E_APPLE_CROATIAN
Definition: StarEncoding.hxx:61
@ E_JIS_X_0208
Definition: StarEncoding.hxx:67
@ E_BIG5
Definition: StarEncoding.hxx:64
@ E_IBM_737
Definition: StarEncoding.hxx:57
@ E_KOI8_U
Definition: StarEncoding.hxx:68
@ E_UCS4
Definition: StarEncoding.hxx:72
@ E_UTF7
Definition: StarEncoding.hxx:65
@ E_IBM_850
Definition: StarEncoding.hxx:55
@ E_IBM_775
Definition: StarEncoding.hxx:58
@ E_IBM_861
Definition: StarEncoding.hxx:55
@ E_IBM_866
Definition: StarEncoding.hxx:58
@ E_MS_1361
Definition: StarEncoding.hxx:67
@ E_IBM_862
Definition: StarEncoding.hxx:58
@ E_ISO_8859_7
Definition: StarEncoding.hxx:57
@ E_APPLE_CENTEURO
Definition: StarEncoding.hxx:61
@ E_IBM_860
Definition: StarEncoding.hxx:55
@ E_APPLE_CHINTRAD
Definition: StarEncoding.hxx:63
@ E_MS_874
Definition: StarEncoding.hxx:59
@ E_ISO_8859_1
Definition: StarEncoding.hxx:56
@ E_IBM_865
Definition: StarEncoding.hxx:56
@ E_IBM_863
Definition: StarEncoding.hxx:55
@ E_EUC_JP
Definition: StarEncoding.hxx:64
@ E_JIS_X_0212
Definition: StarEncoding.hxx:67
@ E_IBM_437
Definition: StarEncoding.hxx:55
@ E_MS_1254
Definition: StarEncoding.hxx:59
@ E_MS_1250
Definition: StarEncoding.hxx:59
@ E_IBM_857
Definition: StarEncoding.hxx:58
@ E_ISO_8859_15
Definition: StarEncoding.hxx:57
@ E_IBM_869
Definition: StarEncoding.hxx:58
@ E_KOI8_R
Definition: StarEncoding.hxx:65
@ E_MS_950
Definition: StarEncoding.hxx:63
@ E_ISO_8859_10
Definition: StarEncoding.hxx:65
@ E_EUC_KR
Definition: StarEncoding.hxx:65
@ E_APPLE_GREEK
Definition: StarEncoding.hxx:61
@ E_MS_1252
Definition: StarEncoding.hxx:55
@ E_BIG5_HKSCS
Definition: StarEncoding.hxx:67
@ E_GBT_12345
Definition: StarEncoding.hxx:64
@ E_ISO_8859_2
Definition: StarEncoding.hxx:56
@ E_MS_1256
Definition: StarEncoding.hxx:59
@ E_ASCII_US
Definition: StarEncoding.hxx:56
@ E_ISO_8859_3
Definition: StarEncoding.hxx:56
@ E_SYMBOL
Definition: StarEncoding.hxx:56
@ E_MS_1251
Definition: StarEncoding.hxx:59
@ E_MS_932
Definition: StarEncoding.hxx:63
@ E_APPLE_CYRILLIC
Definition: StarEncoding.hxx:61
@ E_APPLE_CHINSIMP
Definition: StarEncoding.hxx:63
@ E_UCS2
Definition: StarEncoding.hxx:72
@ E_IBM_852
Definition: StarEncoding.hxx:58
@ E_ISO_8859_14
Definition: StarEncoding.hxx:57
static Encoding getEncodingForId(int id)
return an encoding corresponding to an id
Definition: StarEncoding.cxx:73
static bool convert(std::vector< uint8_t > const &src, Encoding encoding, std::vector< uint32_t > &dest, std::vector< size_t > &srcPositions)
try to convert a list of character and transforms it a unicode's list
Definition: StarEncoding.cxx:61
virtual ~StarEncoding()
destructor
Definition: StarEncoding.cxx:57
static bool read(std::vector< uint8_t > const &src, size_t &pos, Encoding encoding, std::vector< uint32_t > &dest)
try to read a character and add it to string
Definition: StarEncoding.cxx:173
StarEncoding()
constructor
Definition: StarEncoding.cxx:53

Generated on Fri Apr 14 2023 04:41:10 for libstaroffice by doxygen 1.9.6