QCA::Base64

Search for usage in LXR

#include <QtCrypto>

Inheritance diagram for QCA::Base64:

Public Member Functions

 Base64 (Direction dir=Encode)
 
void clear () override
 
MemoryRegion final () override
 
int lineBreaksColumn () const
 
bool lineBreaksEnabled () const
 
bool ok () const override
 
void setLineBreaksColumn (int column)
 
void setLineBreaksEnabled (bool b)
 
MemoryRegion update (const MemoryRegion &a) override
 
- Public Member Functions inherited from QCA::TextFilter
 TextFilter (Direction dir)
 
QString arrayToString (const MemoryRegion &a)
 
MemoryRegion decode (const MemoryRegion &a)
 
QString decodeString (const QString &s)
 
Direction direction () const
 
MemoryRegion encode (const MemoryRegion &a)
 
QString encodeString (const QString &s)
 
void setup (Direction dir)
 
MemoryRegion stringToArray (const QString &s)
 
- Public Member Functions inherited from QCA::Filter
MemoryRegion process (const MemoryRegion &a)
 

Additional Inherited Members

- Protected Attributes inherited from QCA::TextFilter
Direction _dir
 

Detailed Description

Base64 encoding / decoding

Examples
base64test.cpp, publickeyexample.cpp, saslclient.cpp, and saslserver.cpp.

Definition at line 232 of file qca_textfilter.h.

Constructor & Destructor Documentation

◆ Base64()

QCA::Base64::Base64 ( Direction dir = Encode)

Standard constructor.

Parameters
dirthe Direction that should be used.
Note
The direction can be changed using the setup() call.

Member Function Documentation

◆ clear()

void QCA::Base64::clear ( )
overridevirtual

Reset the internal state.

This is useful to reuse an existing Base64 object

Implements QCA::Filter.

◆ final()

MemoryRegion QCA::Base64::final ( )
overridevirtual

Complete the algorithm.

Returns
any remaining output. Because of the way Base64 encoding works, you will get either an empty array, or an array containing one or two "=" (equals, 0x3D) characters.

Implements QCA::Filter.

◆ lineBreaksColumn()

int QCA::Base64::lineBreaksColumn ( ) const

Returns the line break column.

◆ lineBreaksEnabled()

bool QCA::Base64::lineBreaksEnabled ( ) const

Returns true if line breaks are enabled.

◆ ok()

bool QCA::Base64::ok ( ) const
overridevirtual

Test if an update() or final() call succeeded.

Returns
true if the previous call succeeded

Implements QCA::Filter.

◆ setLineBreaksColumn()

void QCA::Base64::setLineBreaksColumn ( int column)

Sets the column that linebreaks should be inserted at when encoding.

Parameters
columnthe column number that line breaks should be inserted at.

◆ setLineBreaksEnabled()

void QCA::Base64::setLineBreaksEnabled ( bool b)

Sets line break mode.

If enabled, linebreaks will be added to encoded output or accepted in encoded input. If disabled, linebreaks in encoded input will cause a failure to decode. The default is disabled.

Parameters
bwhether to enable line breaks (true) or disable line breaks (false)

◆ update()

MemoryRegion QCA::Base64::update ( const MemoryRegion & a)
overridevirtual

Process more data, returning the corresponding encoded or decoded (depending on the Direction set in the constructor or setup() call) representation.

If you find yourself with code that only calls this method once, you might be better off using encode() or decode(). Similarly, if the data is really a string, you might be better off using arrayToString(), encodeString(), stringToArray() or decodeString().

Parameters
athe array containing data to process

Implements QCA::Filter.


The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:47:11 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.