edbee - Qt Editor Library
textcodec.h
Go to the documentation of this file.
1 
6 #include <QObject>
7 #include <QList>
8 #include <QHash>
9 #include <QTextEncoder>
10 
11 namespace edbee {
12 
13 class TextCodec;
14 
19 {
20 public:
23 
24 public:
25  void giveTextCodec( TextCodec* codec );
26  QList<TextCodec*> codecList();
27  TextCodec* codecForName( const QString& name );
28 
29 private:
30  QList<TextCodec*> codecList_;
31  QHash<QString,TextCodec*> codecRefMap_;
32 };
33 
34 
37 class TextCodec
38 {
39 public:
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 
47 private:
48  QString name_;
49  const QTextCodec* codecRef_;
50  QTextCodec::ConversionFlags flags_;
51 
52 };
53 
54 } // edbee
QString name()
Definition: textcodec.h:45
TextCodecManager()
The codecmanager constructs This method registeres all codecs available in Qt.
Definition: textcodec.cpp:17
TextCodec * codecForName(const QString &name)
Returns the given codec for the given name.
Definition: textcodec.cpp:67
This class represents a single text codec The codec has a name and contains methods to create encoder...
Definition: textcodec.h:37
Copyright 2011-2013 - Reliable Bits Software by Blommers IT.
Definition: commentcommand.cpp:22
void giveTextCodec(TextCodec *codec)
Registers the given codec. The ownership of this codec is transfered to the codec manger...
Definition: textcodec.cpp:50
The codec manager is used for managing codecs You shouldnt&#39; instantiatie this class, it&#39;s better to access the codec manager instantiated via the edbee::Edbee.
Definition: textcodec.h:18
~TextCodecManager()
Cleansup the codec list.
Definition: textcodec.cpp:42
QList< TextCodec * > codecList()
Returns the list with all codecs.
Definition: textcodec.cpp:58