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

util to encode data to printable string More...

#include "ZFCoreTypeDef.h"

Go to the source code of this file.

Macros

#define ZFCoreDataEncodeCharMapDefault()
 see ZFCoreDataEncode, default is all numbers and all lower and upper letters
 

Functions

void ZFCoreDataEncode (zfstring &result, const zfchar *src, zfindex srcLen=((zfindex) -1), const zfchar *charMap=_ZFP_ZFCoreDataEncodeCharMapDefault, zfchar escapeToken='%')
 util to encode data to printable string
 
void ZFCoreDataDecode (zfstring &result, const zfchar *src, zfindex srcLen=((zfindex) -1), zfchar escapeToken='%')
 see ZFCoreDataEncode
 

Detailed Description

util to encode data to printable string

Macro Definition Documentation

◆ ZFCoreDataEncodeCharMapDefault

#define ZFCoreDataEncodeCharMapDefault ( )

see ZFCoreDataEncode, default is all numbers and all lower and upper letters

here's a list of contents:

// 0x00 ~ 0x0F
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// 0x10 ~ 0x1F
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// 0x20 ~ 0x2F
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// 0x30 ~ 0x3F
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
// 0x40 ~ 0x4F
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
// 0x50 ~ 0x5F
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
// 0x60 ~ 0x6F
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
// 0x70 ~ 0x7F
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
// 0x80 ~ 0x8F
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// 0x90 ~ 0x9F
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// 0xA0 ~ 0xAF
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// 0xB0 ~ 0xBF
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// 0xC0 ~ 0xCF
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// 0xD0 ~ 0xDF
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// 0xE0 ~ 0xEF
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// 0xF0 ~ 0xFF
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

Function Documentation

◆ ZFCoreDataEncode()

void ZFCoreDataEncode ( zfstring & result,
const zfchar * src,
zfindex srcLen = ((zfindex) -1),
const zfchar * charMap = _ZFP_ZFCoreDataEncodeCharMapDefault,
zfchar escapeToken = '%' )
extern

util to encode data to printable string

use charMap to declare the printable chars, it's a 256 size zfchar array, zero element means the char isn't printable and non-zero means printable
not printable chars would be escaped by escapeToken