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 <memory>
14#include <vector>
15
16#include <unicode/ucnv.h>
17
18namespace libebook
19{
20
22{
23 // disable copying
26
27public:
28 explicit EBOOKCharsetConverter(const char *encoding = nullptr);
30
31 bool guessEncoding(const char *in, unsigned length);
32
33 bool convertBytes(const char *in, unsigned length, std::vector<char> &out);
34
35private:
36 using UConverterPtr_t = std::unique_ptr<UConverter, void (*)(UConverter *)>;
39};
40
41}
42
43#endif // EBOOKCHARSETCONVERTER_H_INCLUDED
44
45/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
const char * encoding
Definition EBOOKHTMLParser.cpp:166
unsigned length
Definition SoftBookParser.cpp:73
Definition EBOOKCharsetConverter.h:22
EBOOKCharsetConverter & operator=(const EBOOKCharsetConverter &other)
UConverterPtr_t m_converterToUnicode
Definition EBOOKCharsetConverter.h:37
EBOOKCharsetConverter(const EBOOKCharsetConverter &other)
bool convertBytes(const char *in, unsigned length, std::vector< char > &out)
Definition EBOOKCharsetConverter.cpp:109
~EBOOKCharsetConverter()
Definition EBOOKCharsetConverter.cpp:87
bool guessEncoding(const char *in, unsigned length)
Definition EBOOKCharsetConverter.cpp:91
std::unique_ptr< UConverter, void(*)(UConverter *)> UConverterPtr_t
Definition EBOOKCharsetConverter.h:36
UConverterPtr_t m_converterToUTF8
Definition EBOOKCharsetConverter.h:38
Definition BBeBCollector.cpp:19

Generated for libe-book by doxygen 1.9.8