• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kio

dataprotocol.cpp File Reference

#include "dataprotocol.h"
#include <kdebug.h>
#include <kmdcodec.h>
#include <kurl.h>
#include <kio/global.h>
#include <qcstring.h>
#include <qstring.h>
#include <qstringlist.h>
#include <qtextcodec.h>

Include dependency graph for dataprotocol.cpp:

Go to the source code of this file.


Defines

#define DISPATCH(f)   dispatch_##f

Functions

QString extract (const QString &buf, int &pos, QChar c1, QChar c2= '\0', QChar c3= '\0')
static int find (const QString &buf, int begin, QChar c1, QChar c2= '\0', QChar c3= '\0')
void ignoreWS (const QString &buf, int &pos)
static void parseDataHeader (const KURL &url, DataHeader &header_info)
static QString parseQuotedString (const QString &buf, int &pos)

Variables

const QChar base64_str [] = { 'b','a','s','e','6','4' }
const QChar charset_str [] = { 'c','h','a','r','s','e','t' }
const QChar text_plain_str [] = { 't','e','x','t','/','p','l','a','i','n' }
const QChar us_ascii_str [] = { 'u','s','-','a','s','c','i','i' }

Define Documentation

#define DISPATCH ( f   )     dispatch_##f

Definition at line 40 of file dataprotocol.cpp.


Function Documentation

QString extract ( const QString &  buf,
int &  pos,
QChar  c1,
QChar  c2 = '\0',
QChar  c3 = '\0' 
) [inline]

extracts the string between the current position pos and the first occurrence of either c1 to c3 exclusively and updates pos to point at the found delimiter or at the end of the buffer if neither character occurred.

Parameters:
buf buffer where to look for
pos zero-indexed position within buffer
c1 character to find
c2 alternative character to find or 0 to ignore
c3 alternative character to find or 0 to ignore

Definition at line 120 of file dataprotocol.cpp.

static int find ( const QString &  buf,
int  begin,
QChar  c1,
QChar  c2 = '\0',
QChar  c3 = '\0' 
) [static]

returns the position of the first occurrence of any of the given characters c1 to c3 or buf.length() if none is contained.

Parameters:
buf buffer where to look for c
begin zero-indexed starting position
c1 character to find
c2 alternative character to find or '' to ignore
c3 alternative character to find or '' to ignore

Definition at line 95 of file dataprotocol.cpp.

void ignoreWS ( const QString &  buf,
int &  pos 
) [inline]

ignores all whitespaces

Parameters:
buf buffer to operate on
pos position to shift to first non-whitespace character Upon return pos will either point to the first non-whitespace character or to the end of the buffer.

Definition at line 133 of file dataprotocol.cpp.

static void parseDataHeader ( const KURL &  url,
DataHeader &  header_info 
) [static]

parses the header of a data url

Parameters:
url the data url
header_info fills the given DataHeader structure with the header information

Definition at line 176 of file dataprotocol.cpp.

static QString parseQuotedString ( const QString &  buf,
int &  pos 
) [static]

parses a quoted string as per rfc 822.

If trailing quote is missing, the whole rest of the buffer is returned.

Parameters:
buf buffer to operate on
pos position pointing to the leading quote
Returns:
the extracted string. pos will be updated to point to the character following the trailing quote.

Definition at line 149 of file dataprotocol.cpp.


Variable Documentation

const QChar base64_str[] = { 'b','a','s','e','6','4' }

Definition at line 85 of file dataprotocol.cpp.

const QChar charset_str[] = { 'c','h','a','r','s','e','t' }

Definition at line 83 of file dataprotocol.cpp.

const QChar text_plain_str[] = { 't','e','x','t','/','p','l','a','i','n' }

Definition at line 82 of file dataprotocol.cpp.

const QChar us_ascii_str[] = { 'u','s','-','a','s','c','i','i' }

Definition at line 84 of file dataprotocol.cpp.

kio

Skip menu "kio"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
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