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 {
52 public:
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 
76  StarEncoding();
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 
85 protected:
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:
Definition: StarEncoding.hxx:62
Definition: StarEncoding.hxx:64
Definition: StarEncoding.hxx:59
Definition: StarEncoding.hxx:64
static Encoding getEncodingForId(int id)
return an encoding corresponding to an id
Definition: StarEncoding.cxx:73
Definition: StarEncoding.hxx:56
Definition: StarEncoding.hxx:55
Definition: StarEncoding.hxx:63
Definition: StarEncoding.hxx:59
Definition: StarEncoding.hxx:67
the main class to read/.
Definition: StarEncoding.hxx:50
Definition: StarEncoding.hxx:55
Definition: StarEncoding.hxx:55
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
Definition: StarEncoding.hxx:65
Definition: StarEncoding.hxx:65
Definition: StarEncoding.hxx:59
Definition: StarEncoding.hxx:59
Definition: StarEncoding.hxx:61
Definition: StarEncoding.hxx:72
Definition: StarEncoding.hxx:55
Definition: StarEncoding.hxx:72
Definition: StarEncoding.hxx:55
Definition: StarEncoding.hxx:56
Definition: StarEncoding.hxx:58
Definition: StarEncoding.hxx:56
Definition: StarEncoding.hxx:57
Definition: StarEncoding.hxx:55
Definition: StarEncoding.hxx:63
Definition: StarEncoding.hxx:61
Definition: StarEncoding.hxx:61
Encoding
the different encoding
Definition: StarEncoding.hxx:54
Definition: StarEncoding.hxx:62
Definition: StarEncoding.hxx:63
Definition: StarEncoding.hxx:56
Definition: StarEncoding.hxx:59
Definition: StarEncoding.hxx:58
Definition: StarEncoding.hxx:67
Definition: StarEncoding.hxx:57
Definition: StarEncoding.hxx:67
Definition: StarEncoding.hxx:64
Definition: StarEncoding.hxx:57
Definition: StarEncoding.hxx:56
Definition: StarEncoding.hxx:65
Definition: StarEncoding.hxx:58
Definition: StarEncoding.hxx:61
Definition: StarEncoding.hxx:61
Definition: StarEncoding.hxx:59
Definition: StarEncoding.hxx:64
StarEncoding()
constructor
Definition: StarEncoding.cxx:53
Definition: StarEncoding.hxx:58
Definition: StarEncoding.hxx:67
Definition: StarEncoding.hxx:63
Definition: StarEncoding.hxx:67
Definition: StarEncoding.hxx:65
Definition: StarEncoding.hxx:63
Definition: StarEncoding.hxx:64
virtual ~StarEncoding()
destructor
Definition: StarEncoding.cxx:57
Definition: StarEncoding.hxx:63
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&#39;s list
Definition: StarEncoding.cxx:61
Definition: StarEncoding.hxx:56
Definition: StarEncoding.hxx:64
Definition: StarEncoding.hxx:57
Definition: StarEncoding.hxx:63
Definition: StarEncoding.hxx:55
Definition: StarEncoding.hxx:68
Definition: StarEncoding.hxx:63
Definition: StarEncoding.hxx:55
Definition: StarEncoding.hxx:64
Definition: StarEncoding.hxx:59
Definition: StarEncoding.hxx:68
Definition: StarEncoding.hxx:57
Definition: StarEncoding.hxx:67
Definition: StarEncoding.hxx:57
Definition: StarEncoding.hxx:57
Definition: StarEncoding.hxx:57
Definition: StarEncoding.hxx:62
Definition: StarEncoding.hxx:59
Definition: StarEncoding.hxx:58
Definition: StarEncoding.hxx:56
Definition: StarEncoding.hxx:62
Definition: StarEncoding.hxx:58
Definition: StarEncoding.hxx:65
Definition: StarEncoding.hxx:58
Definition: StarEncoding.hxx:65
Definition: StarEncoding.hxx:58

Generated on Sat May 29 2021 22:54:03 for libstaroffice by doxygen 1.8.14