ZFFramework
 
Loading...
Searching...
No Matches
ZFBase64.h File Reference

base64 encoder and decoder More...

#include "ZFAlgorithmDef.h"

Go to the source code of this file.

Classes

class  ZFBase64
 util class to process base64 More...
 

Functions

zfstring const & ZFBase64Table (void)
 char table for ZFBase64, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" by default
 
zfchar const & ZFBase64Pad (void)
 pad token for ZFBase64, '=' by default
 
zfindexZFBase64LineBreakPos (void)
 line break position for ZFBase64, zfindexMax by default
 
void ZFBase64LineBreakPos (zfindex const &v)
 see ZFBase64LineBreakPos
 
zfindex const & ZFBase64LineBreakPosStandard (void)
 standard line break position for ZFBase64, 76 by default
 
zfindex ZFBase64EncodeCalcSize (zfindex srcLen, zfindex lineBreakPos=(ZFBase64LineBreakPos()))
 calculate required size to store result, ensured big enough but not ensure exactly the same
 
zfbool ZFBase64Encode (zfchar *buf, const void *src, zfindex srcLen=((zfindex) -1), zfindex *outResultSize=zft_zfnull, const zfchar *table=ZFBase64Table(), zfchar pad=ZFBase64Pad(), zfindex lineBreakPos=ZFBase64LineBreakPos())
 encode base64
 
zfbool ZFBase64Encode (const ZFOutput &outputCallback, const ZFInput &inputCallback, zfindex *outResultSize=(zft_zfnull), const zfchar *table=(ZFBase64Table()), zfchar pad=(ZFBase64Pad()), zfindex lineBreakPos=(ZFBase64LineBreakPos()))
 encode base64, return byte size written even if error occurred
 
zfbool ZFBase64Encode (zfstring &buf, const zfchar *src, zfindex srcLen=(((zfindex) -1)), zfindex *outResultSize=(zft_zfnull), const zfchar *table=(ZFBase64Table()), zfchar pad=(ZFBase64Pad()), zfindex lineBreakPos=(ZFBase64LineBreakPos()))
 encode base64, return byte size written even if error occurred
 
zfindex ZFBase64DecodeCalcSize (zfindex srcLen, zfindex lineBreakPos=(ZFBase64LineBreakPos()))
 calculate required size to store result, ensured big enough but not ensure exactly the same
 
zfbool ZFBase64Decode (void *buf, const zfchar *src, zfindex srcLen=((zfindex) -1), zfindex *outResultSize=zft_zfnull, const zfchar *table=ZFBase64Table(), zfchar pad=ZFBase64Pad())
 encode base64, return byte size written even if error occurred
 
zfbool ZFBase64Decode (const ZFOutput &outputCallback, const ZFInput &inputCallback, zfindex *outResultSize=(zft_zfnull), const zfchar *table=(ZFBase64Table()), zfchar pad=(ZFBase64Pad()))
 encode base64, return byte size written even if error occurred
 
zfbool ZFBase64Decode (zfstring &buf, const zfchar *src, zfindex srcLen=(((zfindex) -1)), zfindex *outResultSize=(zft_zfnull), const zfchar *table=(ZFBase64Table()), zfchar pad=(ZFBase64Pad()))
 encode base64, return byte size written even if error occurred
 

Detailed Description

base64 encoder and decoder

Function Documentation

◆ ZFBase64EncodeCalcSize()

zfindex ZFBase64EncodeCalcSize ( zfindex srcLen,
zfindex lineBreakPos = (ZFBase64LineBreakPos()) )
extern

calculate required size to store result, ensured big enough but not ensure exactly the same

return zfindexMax() if error

◆ ZFBase64DecodeCalcSize()

zfindex ZFBase64DecodeCalcSize ( zfindex srcLen,
zfindex lineBreakPos = (ZFBase64LineBreakPos()) )
extern

calculate required size to store result, ensured big enough but not ensure exactly the same

return zfindexMax() if error

◆ ZFBase64Decode()

zfbool ZFBase64Decode ( void * buf,
const zfchar * src,
zfindex srcLen = ((zfindex) -1),
zfindex * outResultSize = zft_zfnull,
const zfchar * table = ZFBase64Table(),
zfchar pad = ZFBase64Pad() )
extern

encode base64, return byte size written even if error occurred

extra space, tab, '\r', '\n' is allowed, missing pad is allowed