add function char_converter_set_pair

pull/10/head
yuqing 2016-11-25 10:11:40 +08:00
parent abc9882418
commit 8cb8c29c45
2 changed files with 17 additions and 0 deletions

View File

@ -60,6 +60,12 @@ int std_space_char_converter_init(FastCharConverter *pCharConverter,
return char_converter_init(pCharConverter, pairs, SPACE_CHAR_PAIR_COUNT); return char_converter_init(pCharConverter, pairs, SPACE_CHAR_PAIR_COUNT);
} }
void char_converter_set_pair(FastCharConverter *pCharConverter,
const unsigned char src, const unsigned char dest)
{
pCharConverter->char_table[src] = dest;
}
int fast_char_convert(FastCharConverter *pCharConverter, int fast_char_convert(FastCharConverter *pCharConverter,
char *text, const int text_len) char *text, const int text_len)
{ {

View File

@ -60,6 +60,17 @@ int char_converter_init(FastCharConverter *pCharConverter,
int std_space_char_converter_init(FastCharConverter *pCharConverter, int std_space_char_converter_init(FastCharConverter *pCharConverter,
const unsigned char dest_base); const unsigned char dest_base);
/**
* standard space chars to convert
* parameters:
* pCharConverter: the char converter
* src: the src char
* dest: the dest char
* return: none
*/
void char_converter_set_pair(FastCharConverter *pCharConverter,
const unsigned char src, const unsigned char dest);
/** /**
* char convert function * char convert function
* parameters: * parameters: