test_htuu.cc

来自「liburl是一个小的C++库」· CC 代码 · 共 30 行

CC
30
字号
#include <string>#include <url/htuu_string.hh>#include <iterator>int main(int, char **)	{	vector<char> decoded;	for(unsigned int i=0; i<256; ++i)		decoded.push_back(i);	string encoded;		htuu_encode(decoded.begin,decoded.end(),back_insert_iterator<string>(encoded));	cout << "encoded: " << encoded << endl;/*	vector<char> decoded_again=htuu_decode(encoded);	if(decoded_again.size()!=decoded.size() {		cout << "sizes do not match" << endl;		return 1;		}	for(unsigned int i=0; i<256; ++i)		if(decoded_again[i]!=decode[i]) {			cout << "character " << i << " did not survive" << endl;			} */	return 0;	}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?