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

KMIME Library

kmime_charfreq.h

Go to the documentation of this file.
00001 /*  -*- c++ -*-
00002     kmime_charfreq.h
00003 
00004     KMime, the KDE internet mail/usenet news message library.
00005     Copyright (c) 2001-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 */
00051 #ifndef __KMIME_CHARFREQ_H__
00052 #define __KMIME_CHARFREQ_H__
00053 
00054 #include <QtCore/QByteArray>
00055 #include "kmime_export.h"
00056 #undef None
00057 
00058 namespace KMime {
00059 
00072 class KMIME_EXPORT CharFreq
00073 {
00074   public:
00081     explicit CharFreq( const QByteArray &buf );
00082 
00090     CharFreq( const char *buf, size_t len );
00091 
00095     enum Type {
00096       None = 0,              
00097       EightBitData,          
00098       Binary = EightBitData, 
00099       SevenBitData,          
00100       EightBitText,          
00101       SevenBitText           
00102     };
00103 
00107     Type type() const;
00108 
00112     bool isEightBitData() const;
00113 
00117     bool isEightBitText() const;
00118 
00122     bool isSevenBitData() const;
00123 
00127     bool isSevenBitText() const;
00128 
00133     bool hasTrailingWhitespace() const;
00134 
00138     bool hasLeadingFrom() const;
00139 
00144     float printableRatio() const;
00145 
00150     float controlCodesRatio() const;
00151 
00152   private:
00153     //@cond PRIVATE
00154     uint mNUL;         // count of NUL chars
00155     uint mCTL;         // count of CTLs (incl. DEL, excl. CR, LF, HT)
00156     uint mCR;          // count of CR chars
00157     uint mLF;          // count of LF chars
00158     uint mCRLF;        // count of LFs, preceded by CRs
00159     uint mPrintable;   // count of printable US-ASCII chars (SPC..~)
00160     uint mEightBit;    // count of other latin1 chars (those with 8th bit set)
00161     uint mTotal;       // count of all chars
00162     uint mLineMin;     // minimum line length
00163     uint mLineMax;     // maximum line length
00164     bool mTrailingWS;  // does the buffer contain trailing whitespace?
00165     bool mLeadingFrom; // does the buffer contain lines starting with "From "?
00166     //@endcond
00167 
00174     void count( const char *buf, size_t len );
00175 };
00176 
00177 } // namespace KMime
00178 
00179 #endif /* __KMIME_CHARFREQ_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
  • kabc
  • kblog
  • kcal
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.4
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