• Skip to content
  • Skip to link menu
KDE 4.5 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

KMIME Library

kmime_codec_uuencode.h

Go to the documentation of this file.
00001 /*  -*- c++ -*-
00002     kmime_codec_uuencode.h
00003 
00004     KMime, the KDE Internet mail/usenet news message library.
00005     Copyright (c) 2002 Marc Mutz <mutz@kde.org>
00006 
00007     This library is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU Library General Public
00009     License as published by the Free Software Foundation; either
00010     version 2 of the License, or (at your option) any later version.
00011 
00012     This library is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     Library General Public License for more details.
00016 
00017     You should have received a copy of the GNU Library General Public License
00018     along with this library; see the file COPYING.LIB.  If not, write to
00019     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020     Boston, MA 02110-1301, USA.
00021 */
00037 #ifndef __KMIME_CODEC_UUENCODE_H__
00038 #define __KMIME_CODEC_UUENCODE_H__
00039 
00040 #include "kmime_codecs.h"
00041 
00042 namespace KMime {
00043 
00048 class KMIME_EXPORT UUCodec : public Codec
00049 {
00050   protected:
00051     friend class Codec;
00055     UUCodec() : Codec() {}
00056 
00057   public:
00061     virtual ~UUCodec() {}
00062 
00067     const char *name() const
00068       { return "x-uuencode"; }
00069 
00074     int maxEncodedSizeFor( int insize, bool withCRLF=false ) const
00075       {
00076         (void)withCRLF;
00077         return insize; // we have no encoder!
00078       }
00079 
00084     int maxDecodedSizeFor( int insize, bool withCRLF=false ) const
00085       {
00086         // assuming all characters are part of the uuencode stream (which
00087         // does almost never hold due to required linebreaking; but
00088         // additional non-uu chars don't affect the output size), each
00089         // 4-tupel of them becomes a 3-tupel in the decoded octet
00090         // stream. So:
00091         int result = ( ( insize + 3 ) / 4 ) * 3;
00092         // but all of them may be \n, so
00093         if ( withCRLF ) {
00094           result *= 2; // :-o
00095         }
00096         return result;
00097       }
00098 
00103     Encoder *makeEncoder( bool withCRLF=false ) const;
00104 
00109     Decoder *makeDecoder( bool withCRLF=false ) const;
00110 };
00111 
00112 } // namespace KMime
00113 
00114 #endif // __KMIME_CODEC_UUENCODE_H__

KMIME Library

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

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kblog
  • kcal
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.7.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal