• Skip to content
  • Skip to link menu
KDE 4.7 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • KDE Home
  • Contact Us
 

KMIME Library

  • KMime
  • CharFreq
Public Types | Public Member Functions
KMime::CharFreq Class Reference

#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 QByteArray &buf)
 CharFreq (const char *buf, size_t len)
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

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 101 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:
bufis a QByteArray containing the data.

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:
bufis a pointer to a character string containing the data.
lenis 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
  • 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
  • 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.5
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