• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KIO

Public Member Functions | Protected Member Functions | List of all members
KRemoteEncoding Class Reference

#include <kremoteencoding.h>

Public Member Functions

 KRemoteEncoding (const char *name=0)
 
virtual ~KRemoteEncoding ()
 
QString decode (const QByteArray &name) const
 
QByteArray directory (const KUrl &url, bool ignore_trailing_slash=true) const
 
QByteArray encode (const QString &name) const
 
QByteArray encode (const KUrl &url) const
 
const char * encoding () const
 
int encodingMib () const
 
QByteArray fileName (const KUrl &url) const
 
void setEncoding (const char *name)
 

Protected Member Functions

virtual void virtual_hook (int id, void *data)
 

Detailed Description

Allows encoding and decoding properly remote filenames into Unicode.

Certain protocols do not specify an appropriate encoding for decoding their 8-bit data into proper Unicode forms. Therefore, ioslaves should use this class in order to convert those forms into QStrings before creating the respective KIO::UDSEntry. The same is true for decoding URLs to its components.

Each KIO::SlaveBase has one object of this kind, even if it is not necessary. It can be accessed through KIO::SlaveBase::remoteEncoding.

A class for handling remote filenames

Author
Thiago Macieira thiag.nosp@m.o.ma.nosp@m.cieir.nosp@m.a@kd.nosp@m.email.nosp@m..net

Definition at line 44 of file kremoteencoding.h.

Constructor & Destructor Documentation

KRemoteEncoding::KRemoteEncoding ( const char *  name = 0)
explicit

Constructor.

Constructs this object to use the given encoding name. If name is a null pointer, the standard encoding will be used.

Definition at line 38 of file kremoteencoding.cpp.

KRemoteEncoding::~KRemoteEncoding ( )
virtual

Destructor.

Definition at line 44 of file kremoteencoding.cpp.

Member Function Documentation

QString KRemoteEncoding::decode ( const QByteArray &  name) const

Converts the given full pathname or filename to Unicode.

This function is supposed to work for dirnames, filenames or a full pathname.

Definition at line 49 of file kremoteencoding.cpp.

QByteArray KRemoteEncoding::directory ( const KUrl &  url,
bool  ignore_trailing_slash = true 
) const

Converts the given URL into 8-bit form and separate the dirname from the filename.

This is useful for slave functions like stat or get.

The dirname is returned with the final slash always stripped

Definition at line 78 of file kremoteencoding.cpp.

QByteArray KRemoteEncoding::encode ( const QString &  name) const

Converts the given name from Unicode.

This function is supposed to work for dirnames, filenames or a full pathname.

Definition at line 64 of file kremoteencoding.cpp.

QByteArray KRemoteEncoding::encode ( const KUrl &  url) const

Converts the given URL into its 8-bit components.

Definition at line 73 of file kremoteencoding.cpp.

const char * KRemoteEncoding::encoding ( ) const

Returns the encoding being used.

Definition at line 90 of file kremoteencoding.cpp.

int KRemoteEncoding::encodingMib ( ) const

Returns the MIB for the codec being used.

Definition at line 95 of file kremoteencoding.cpp.

QByteArray KRemoteEncoding::fileName ( const KUrl &  url) const

Converts the given URL into 8-bit form and retrieve the filename.

Definition at line 85 of file kremoteencoding.cpp.

void KRemoteEncoding::setEncoding ( const char *  name)

Sets the encoding being used.

This function does not change the global configuration.

Pass a null pointer in name to revert to the standard encoding.

Definition at line 100 of file kremoteencoding.cpp.

void KRemoteEncoding::virtual_hook ( int  id,
void *  data 
)
protectedvirtual

Definition at line 119 of file kremoteencoding.cpp.


The documentation for this class was generated from the following files:
  • kremoteencoding.h
  • kremoteencoding.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:55 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal