EBOOKCharsetConverter.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3  * This file is part of the libe-book project.
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 
10 #ifndef EBOOKCHARSETCONVERTER_H_INCLUDED
11 #define EBOOKCHARSETCONVERTER_H_INCLUDED
12 
13 #include <vector>
14 
15 #include <unicode/ucnv.h>
16 
17 namespace libebook
18 {
19 
21 {
22  // disable copying
25 
26 public:
27  explicit EBOOKCharsetConverter(const char *encoding = 0);
29 
30  bool guessEncoding(const char *in, unsigned length);
31 
32  bool convertBytes(const char *in, unsigned length, std::vector<char> &out);
33 
34 private:
35  UConverter *m_converterToUnicode;
36  UConverter *m_converterToUTF8;
37 };
38 
39 }
40 
41 #endif // EBOOKCHARSETCONVERTER_H_INCLUDED
42 
43 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
EBOOKCharsetConverter & operator=(const EBOOKCharsetConverter &other)
Definition: EBOOKCharsetConverter.h:20
bool convertBytes(const char *in, unsigned length, std::vector< char > &out)
Definition: EBOOKCharsetConverter.cpp:117
~EBOOKCharsetConverter()
Definition: EBOOKCharsetConverter.cpp:91
bool guessEncoding(const char *in, unsigned length)
Definition: EBOOKCharsetConverter.cpp:99
Definition: CHMParser.cpp:20
EBOOKCharsetConverter(const EBOOKCharsetConverter &other)
unsigned length
Definition: IMPParser.cpp:72
UConverter * m_converterToUnicode
Definition: EBOOKCharsetConverter.h:35
const char * encoding
Definition: EBOOKHTMLParser.cpp:172
UConverter * m_converterToUTF8
Definition: EBOOKCharsetConverter.h:36

Generated for libe-book by doxygen 1.8.8