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

KMIME Library

  • sources
  • kde-4.12
  • kdepimlibs
  • kmime
kmime_codec_uuencode.h
Go to the documentation of this file.
1 /* -*- c++ -*-
2  kmime_codec_uuencode.h
3 
4  KMime, the KDE Internet mail/usenet news message library.
5  Copyright (c) 2002 Marc Mutz <mutz@kde.org>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License as published by the Free Software Foundation; either
10  version 2 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to
19  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 */
37 #ifndef __KMIME_CODEC_UUENCODE_H__
38 #define __KMIME_CODEC_UUENCODE_H__
39 
40 #include "kmime_codecs.h"
41 
42 namespace KMime {
43 
48 class KMIME_EXPORT UUCodec : public Codec
49 {
50  protected:
51  friend class Codec;
55  UUCodec() : Codec() {}
56 
57  public:
61  virtual ~UUCodec() {}
62 
67  const char *name() const
68  { return "x-uuencode"; }
69 
74  int maxEncodedSizeFor( int insize, bool withCRLF=false ) const
75  {
76  (void)withCRLF;
77  return insize; // we have no encoder!
78  }
79 
84  int maxDecodedSizeFor( int insize, bool withCRLF=false ) const
85  {
86  // assuming all characters are part of the uuencode stream (which
87  // does almost never hold due to required linebreaking; but
88  // additional non-uu chars don't affect the output size), each
89  // 4-tupel of them becomes a 3-tupel in the decoded octet
90  // stream. So:
91  int result = ( ( insize + 3 ) / 4 ) * 3;
92  // but all of them may be \n, so
93  if ( withCRLF ) {
94  result *= 2; // :-o
95  }
96  return result;
97  }
98 
103  Encoder *makeEncoder( bool withCRLF=false ) const;
104 
109  Decoder *makeDecoder( bool withCRLF=false ) const;
110 };
111 
112 } // namespace KMime
113 
114 #endif // __KMIME_CODEC_UUENCODE_H__
kmime_codecs.h
This file is part of the API for handling MIME data and defines the Codec class.
KMime::UUCodec::UUCodec
UUCodec()
Constructs a UUEncode codec.
Definition: kmime_codec_uuencode.h:55
KMime::Encoder
Stateful encoder class.
Definition: kmime_codecs.h:394
KMime::UUCodec::~UUCodec
virtual ~UUCodec()
Destroys the codec.
Definition: kmime_codec_uuencode.h:61
KMime::UUCodec::name
const char * name() const
Definition: kmime_codec_uuencode.h:67
KMime::Codec
An abstract base class of codecs for common mail transfer encodings.
Definition: kmime_codecs.h:83
KMime::Decoder
Stateful CTE decoder class.
Definition: kmime_codecs.h:341
KMime::UUCodec
A class representing the UUEncode codec.
Definition: kmime_codec_uuencode.h:48
KMime::UUCodec::maxDecodedSizeFor
int maxDecodedSizeFor(int insize, bool withCRLF=false) const
Definition: kmime_codec_uuencode.h:84
KMime::UUCodec::maxEncodedSizeFor
int maxEncodedSizeFor(int insize, bool withCRLF=false) const
Definition: kmime_codec_uuencode.h:74
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KMIME Library

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

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

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