Exemplo n.º 1
0
int getEncoded(LPBYTE pInput, int len)
{
	int bufLen = len*2;
	BYTE* ptmp = new BYTE[bufLen];

	memset(ptmp, 0, bufLen);
	memcpy(ptmp, pInput, len);
	int mnEncodedLen = sqlite3_encode_binary(ptmp, len, pInput);
	
	delete[] ptmp;
	return mnEncodedLen;
}
Exemplo n.º 2
0
const unsigned char* CppSQLite3Binary::getEncoded()
{
	if (!mbEncoded)
	{
		unsigned char* ptmp = (unsigned char*)malloc(mnBinaryLen);
		memcpy(ptmp, mpBuf, mnBinaryLen);
		mnEncodedLen = sqlite3_encode_binary(ptmp, mnBinaryLen, mpBuf);
		free(ptmp);
		mbEncoded = true;
	}

	return mpBuf;
}