• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

okteta

  • sources
  • kde-4.12
  • kdesdk
  • okteta
  • core
  • codecs
textcharcodec.h
Go to the documentation of this file.
1 /*
2  This file is part of the Okteta Core library, made within the KDE community.
3 
4  Copyright 2004,2011 Friedrich W. H. Kossebau <kossebau@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) version 3, or any
10  later version accepted by the membership of KDE e.V. (or its
11  successor approved by the membership of KDE e.V.), which shall
12  act as a proxy defined in Section 6 of version 3 of the license.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public
20  License along with this library. If not, see <http://www.gnu.org/licenses/>.
21 */
22 
23 #ifndef OKTETA_TEXTCHARCODEC_H
24 #define OKTETA_TEXTCHARCODEC_H
25 
26 // lib
27 #include <charcodec.h>
28 // Qt
29 #include <QtCore/QString>
30 
31 class QTextCodec;
32 class QTextDecoder;
33 class QTextEncoder;
34 
35 
36 namespace Okteta
37 {
38 
39 // used by all codecs with full char coping, i.e. there are no undefined chars
40 class TextCharCodec : public CharCodec
41 {
42  public:
43  static TextCharCodec* createCodec( const QString& codeName );
44  static TextCharCodec* createCodec( CharCoding charCoding );
45  static TextCharCodec* createLocalCodec();
46 
47  static const QStringList& codecNames();
48 
49  protected:
50  TextCharCodec( QTextCodec* textCodec );
51  public:
52  virtual ~TextCharCodec();
53 
54  public: // CharCodec API
55  virtual Character decode( Byte byte ) const;
56  virtual bool encode( Byte* byte, const QChar& _char ) const;
57  virtual bool canEncode( const QChar& _char ) const;
58  virtual const QString& name() const;
59 
60  protected:
61  QTextCodec* mCodec;
63  QTextDecoder* mDecoder;
65  QTextEncoder* mEncoder;
67  mutable QString mName;
68 };
69 
70 }
71 
72 #endif
Okteta::TextCharCodec::mEncoder
QTextEncoder * mEncoder
encodes the chars from unicode
Definition: textcharcodec.h:65
Okteta::TextCharCodec::codecNames
static const QStringList & codecNames()
Definition: textcharcodec.cpp:197
Okteta::CharCoding
CharCoding
Definition: oktetacore.h:39
Okteta::Byte
unsigned char Byte
Definition: byte.h:29
Okteta::TextCharCodec::mName
QString mName
Definition: textcharcodec.h:67
Okteta::TextCharCodec::mCodec
QTextCodec * mCodec
Definition: textcharcodec.h:61
Okteta::TextCharCodec::createLocalCodec
static TextCharCodec * createLocalCodec()
Definition: textcharcodec.cpp:178
Okteta::TextCharCodec::encode
virtual bool encode(Byte *byte, const QChar &_char) const
Definition: textcharcodec.cpp:231
Okteta::TextCharCodec::TextCharCodec
TextCharCodec(QTextCodec *textCodec)
Definition: textcharcodec.cpp:219
Okteta::TextCharCodec
Definition: textcharcodec.h:40
Okteta::CharCodec
Definition: charcodec.h:42
Okteta::TextCharCodec::name
virtual const QString & name() const
Definition: textcharcodec.cpp:258
Okteta::TextCharCodec::mDecoder
QTextDecoder * mDecoder
decodes the chars to unicode
Definition: textcharcodec.h:63
charcodec.h
Okteta::TextCharCodec::~TextCharCodec
virtual ~TextCharCodec()
Definition: textcharcodec.cpp:266
Okteta::TextCharCodec::canEncode
virtual bool canEncode(const QChar &_char) const
Definition: textcharcodec.cpp:226
Okteta::TextCharCodec::decode
virtual Character decode(Byte byte) const
Definition: textcharcodec.cpp:246
Okteta::Character
Definition: character.h:35
Okteta::TextCharCodec::createCodec
static TextCharCodec * createCodec(const QString &codeName)
Definition: textcharcodec.cpp:187
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:04:09 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okteta

Skip menu "okteta"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal