• Skip to content
  • Skip to link menu
KDE 4.8 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • KDE Home
  • 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 */
00057 #ifndef __KMIME_CHARFREQ_H__
00058 #define __KMIME_CHARFREQ_H__
00059 
00060 #include <QtCore/QByteArray>
00061 #include "kmime_export.h"
00062 #undef None
00063 
00064 namespace KMime {
00065 
00078 class KMIME_EXPORT CharFreq
00079 {
00080   public:
00087     explicit CharFreq( const QByteArray &buf );
00088 
00096     CharFreq( const char *buf, size_t len );
00097 
00101     enum Type {
00102       None = 0,              
00103       EightBitData,          
00104       Binary = EightBitData, 
00105       SevenBitData,          
00106       EightBitText,          
00107       SevenBitText           
00108     };
00109 
00113     Type type() const;
00114 
00118     bool isEightBitData() const;
00119 
00123     bool isEightBitText() const;
00124 
00128     bool isSevenBitData() const;
00129 
00133     bool isSevenBitText() const;
00134 
00139     bool hasTrailingWhitespace() const;
00140 
00144     bool hasLeadingFrom() const;
00145 
00150     float printableRatio() const;
00151 
00156     float controlCodesRatio() const;
00157 
00158   private:
00159     //@cond PRIVATE
00160     uint mNUL;         // count of NUL chars
00161     uint mCTL;         // count of CTLs (incl. DEL, excl. CR, LF, HT)
00162     uint mCR;          // count of CR chars
00163     uint mLF;          // count of LF chars
00164     uint mCRLF;        // count of LFs, preceded by CRs
00165     uint mPrintable;   // count of printable US-ASCII chars (SPC..~)
00166     uint mEightBit;    // count of other latin1 chars (those with 8th bit set)
00167     uint mTotal;       // count of all chars
00168     uint mLineMin;     // minimum line length
00169     uint mLineMax;     // maximum line length
00170     bool mTrailingWS;  // does the buffer contain trailing whitespace?
00171     bool mLeadingFrom; // does the buffer contain lines starting with "From "?
00172     //@endcond
00173 
00180     void count( const char *buf, size_t len );
00181 };
00182 
00183 } // namespace KMime
00184 
00185 #endif /* __KMIME_CHARFREQ_H__ */

KMIME Library

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

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • 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.6.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