You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.9 KiB
63 lines
1.9 KiB
15 years ago
|
/*
|
||
|
qutf7codecplugin.cpp
|
||
|
|
||
15 years ago
|
A TQTextCodec for UTF-7 (rfc2152).
|
||
15 years ago
|
Copyright (c) 2001 Marc Mutz <mutz@kde.org>
|
||
|
See file COPYING for details
|
||
|
|
||
|
This program is free software; you can redistribute it and/or modify
|
||
|
it under the terms of the GNU General Public License, version 2.0,
|
||
|
as published by the Free Software Foundation.
|
||
|
|
||
|
You should have received a copy of the GNU General Public License
|
||
|
along with this program; if not, write to the Free Software
|
||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||
|
02110-1301, US
|
||
|
|
||
|
As a special exception, permission is granted to use this plugin
|
||
14 years ago
|
with any version of TQt by TrollTech AS, Norway. In this case, the
|
||
15 years ago
|
use of this plugin doesn't cause the resulting executable to be
|
||
|
covered by the GNU General Public License.
|
||
14 years ago
|
This exception does not however tqinvalidate any other reasons why the
|
||
15 years ago
|
executable file might be covered by the GNU General Public License.
|
||
|
*/
|
||
|
|
||
|
#include "qutf7codec.h"
|
||
|
|
||
15 years ago
|
#include <tqtextcodecplugin.h>
|
||
|
#include <tqstring.h>
|
||
|
#include <tqstringlist.h>
|
||
|
#include <tqvaluelist.h>
|
||
15 years ago
|
|
||
15 years ago
|
class TQTextCodec;
|
||
15 years ago
|
|
||
|
// ######### This file isn't compiled currently
|
||
|
|
||
14 years ago
|
class TQUtf7CodecPlugin : public TQTextCodecPlugin {
|
||
15 years ago
|
public:
|
||
14 years ago
|
TQUtf7CodecPlugin() {}
|
||
15 years ago
|
|
||
15 years ago
|
TQStringList names() const { return TQStringList() << "UTF-7" << "X-QT-UTF-7-STRICT"; }
|
||
|
TQValueList<int> mibEnums() const { return TQValueList<int>() << 1012 << -1012; }
|
||
|
TQTextCodec * createForMib( int );
|
||
|
TQTextCodec * createForName( const TQString & );
|
||
15 years ago
|
};
|
||
|
|
||
14 years ago
|
TQTextCodec * TQUtf7CodecPlugin::createForMib( int mib ) {
|
||
15 years ago
|
if ( mib == 1012 )
|
||
14 years ago
|
return new TQUtf7Codec();
|
||
15 years ago
|
else if ( mib == -1012 )
|
||
14 years ago
|
return new TQStrictUtf7Codec();
|
||
15 years ago
|
return 0;
|
||
|
}
|
||
|
|
||
14 years ago
|
TQTextCodec * TQUtf7CodecPlugin::createForName( const TQString & name ) {
|
||
15 years ago
|
if ( name == "UTF-7" )
|
||
14 years ago
|
return new TQUtf7Codec();
|
||
15 years ago
|
else if ( name == "X-QT-UTF-7-STRICT" )
|
||
14 years ago
|
return new TQStrictUtf7Codec();
|
||
15 years ago
|
return 0;
|
||
|
}
|
||
|
|
||
14 years ago
|
KDE_TQ_EXPORT_PLUGIN( TQUtf7CodecPlugin );
|