edbee - Qt Editor Library v0.11.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
textcodec.h
Go to the documentation of this file.
1// edbee - Copyright (c) 2012-2025 by Rick Blommers and contributors
2// SPDX-License-Identifier: MIT
3
4#pragma once
5
6#include "edbee/exports.h"
7
8#include <QObject>
9#include <QList>
10#include <QHash>
11#include <QTextEncoder>
12
13namespace edbee {
14
15class TextCodec;
16
21public:
24
25public:
26 void giveTextCodec( TextCodec* codec );
27 QList<TextCodec*> codecList();
28 TextCodec* codecForName( const QString& name );
29
30private:
31 QList<TextCodec*> codecList_;
32 QHash<QString,TextCodec*> codecRefMap_;
33};
34
35
39public:
40 TextCodec( const QString& name, const QTextCodec* codec, QTextCodec::ConversionFlags flags );
41 const QTextCodec* codec();
42 QTextEncoder* makeEncoder();
43 QTextDecoder* makeDecoder();
44
45 QString name() { return name_; }
46
47private:
48 QString name_;
49 const QTextCodec* codecRef_;
50 QTextCodec::ConversionFlags flags_;
51
52};
53
54} // edbee
This class represents a single text codec The codec has a name and contains methods to create encoder...
Definition textcodec.h:38
QString name()
Definition textcodec.h:45
TextCodec(const QString &name, const QTextCodec *codec, QTextCodec::ConversionFlags flags)
The default constructs for a textcodec.
Definition textcodec.cpp:78
QTextEncoder * makeEncoder()
Creates a QTextEncoder.
Definition textcodec.cpp:93
QTextDecoder * makeDecoder()
Creates a QTextDecodec.
Definition textcodec.cpp:100
const QTextCodec * codec()
Returns the QTextCodec reference.
Definition textcodec.cpp:87
QList< TextCodec * > codecList()
Returns the list with all codecs.
Definition textcodec.cpp:56
TextCodecManager()
The codecmanager constructs This method registeres all codecs available in Qt.
Definition textcodec.cpp:15
TextCodec * codecForName(const QString &name)
Returns the given codec for the given name.
Definition textcodec.cpp:65
void giveTextCodec(TextCodec *codec)
Registers the given codec. The ownership of this codec is transfered to the codec manager.
Definition textcodec.cpp:48
#define EDBEE_EXPORT
Definition exports.h:15
QT Acessibility has an issue with reporting blank lines between elements lines. defining 'WINDOWS_EMP...
Definition commentcommand.cpp:20