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

KMIME Library

KMime::CharFreq

KMime::CharFreq Class Reference

A class for performing basic data typing using frequency count heuristics. More...

#include <kmime_charfreq.h>

List of all members.


Public Types

enum  Type {
  None = 0, EightBitData, Binary = EightBitData, SevenBitData,
  EightBitText, SevenBitText
}

Public Member Functions

 CharFreq (const char *buf, size_t len)
 CharFreq (const QByteArray &buf)
float controlCodesRatio () const
bool hasLeadingFrom () const
bool hasTrailingWhitespace () const
bool isEightBitData () const
bool isEightBitText () const
bool isSevenBitData () const
bool isSevenBitText () const
float printableRatio () const
Type type () const

Detailed Description

A class for performing basic data typing using frequency count heuristics.

This class performs character frequency counts on the provided data which are used in heuristics to determine a basic data type. The data types are:

  • Eight-Bit-Binary
  • Eight-Bit-Text
  • Seven-Bit-Binary
  • Seven-Bit-Text

Definition at line 72 of file kmime_charfreq.h.


Member Enumeration Documentation

enum KMime::CharFreq::Type

The different types of data.

Enumerator:
None  Unknown.
EightBitData  8bit binary
Binary  8bit binary
SevenBitData  7bit binary
EightBitText  8bit text
SevenBitText  7bit text

Definition at line 95 of file kmime_charfreq.h.


Constructor & Destructor Documentation

CharFreq::CharFreq ( const QByteArray &  buf  )  [explicit]

Constructs a Character Frequency instance for a buffer buf of QByteArray data.

Private class that helps to provide binary compatibility between releases.

Parameters:
buf is a QByteArray containing the data.

For internal use only.

Definition at line 49 of file kmime_charfreq.cpp.

CharFreq::CharFreq ( const char *  buf,
size_t  len 
)

Constructs a Character Frequency instance for a buffer buf of chars of length len.

Parameters:
buf is a pointer to a character string containing the data.
len is the length of buf, in characters.

Definition at line 67 of file kmime_charfreq.cpp.


Member Function Documentation

float CharFreq::controlCodesRatio (  )  const

Returns the percentage of control code characters (CTLs) in the data.

The result is undefined if the number of data characters is zero.

Definition at line 244 of file kmime_charfreq.cpp.

bool CharFreq::hasLeadingFrom (  )  const

Returns true if the data contains a line that starts with "From ".

Definition at line 190 of file kmime_charfreq.cpp.

bool CharFreq::hasTrailingWhitespace (  )  const

Returns true if the data contains trailing whitespace.

i.e., if any line ends with space (' ') or tab ('\t').

Definition at line 185 of file kmime_charfreq.cpp.

bool CharFreq::isEightBitData (  )  const

Returns true if the data Type is EightBitData; false otherwise.

Definition at line 165 of file kmime_charfreq.cpp.

bool CharFreq::isEightBitText (  )  const

Returns true if the data Type is EightBitText; false otherwise.

Definition at line 170 of file kmime_charfreq.cpp.

bool CharFreq::isSevenBitData (  )  const

Returns true if the data Type is SevenBitData; false otherwise.

Definition at line 175 of file kmime_charfreq.cpp.

bool CharFreq::isSevenBitText (  )  const

Returns true if the data Type is SevenBitText; false otherwise.

Definition at line 180 of file kmime_charfreq.cpp.

float CharFreq::printableRatio (  )  const

Returns the percentage of printable characters in the data.

The result is undefined if the number of data characters is zero.

Definition at line 235 of file kmime_charfreq.cpp.

CharFreq::Type CharFreq::type (  )  const

Returns the data Type as derived from the class heuristics.

Definition at line 195 of file kmime_charfreq.cpp.


The documentation for this class was generated from the following files:
  • kmime_charfreq.h
  • kmime_charfreq.cpp

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
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.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