EBOOKCharsetConverter.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* libe-book
3  * Version: MPL 2.0 / LGPLv2.1+
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  * Alternatively, the contents of this file may be used under the terms
10  * of the GNU Lesser General Public License Version 2.1 or later
11  * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
12  * applicable instead of those above.
13  *
14  * For further information visit http://libebook.sourceforge.net
15  */
16 
17 #ifndef EBOOKCHARSETCONVERTER_H_INCLUDED
18 #define EBOOKCHARSETCONVERTER_H_INCLUDED
19 
20 #include <vector>
21 
22 #include <unicode/ucnv.h>
23 
24 namespace libebook
25 {
26 
28 {
29  // disable copying
32 
33 public:
34  explicit EBOOKCharsetConverter(const char *encoding = 0);
36 
37  bool guessEncoding(const char *in, unsigned length);
38 
39  bool convertBytes(const char *in, unsigned length, std::vector<char> &out);
40 
41 private:
42  UConverter *m_converterToUnicode;
43  UConverter *m_converterToUTF8;
44 };
45 
46 }
47 
48 #endif // EBOOKCHARSETCONVERTER_H_INCLUDED
49 
50 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
EBOOKCharsetConverter & operator=(const EBOOKCharsetConverter &other)
Definition: EBOOKCharsetConverter.h:27
bool convertBytes(const char *in, unsigned length, std::vector< char > &out)
Definition: EBOOKCharsetConverter.cpp:122
~EBOOKCharsetConverter()
Definition: EBOOKCharsetConverter.cpp:96
bool guessEncoding(const char *in, unsigned length)
Definition: EBOOKCharsetConverter.cpp:104
EBOOKCharsetConverter(const EBOOKCharsetConverter &other)
unsigned length
Definition: IMPParser.cpp:77
UConverter * m_converterToUnicode
Definition: EBOOKCharsetConverter.h:42
UConverter * m_converterToUTF8
Definition: EBOOKCharsetConverter.h:43

Generated for libe-book by doxygen 1.8.5