2013-03-21 00:47:40 |
Paul J. Lucas |
description |
ItemFactory contains:
Item createBase64Binary(const char* aBinData, size_t aLength) = 0;
Item createBase64Binary(const unsigned char* aBinData, size_t aLength) = 0;
The former expects base64-encoded data; the latter expected raw binary data that is then encoded. IMHO, the distinction between char* and unsigned char* is too subtle. You can't tell by looking at a call to either function whether it's calling the first or second -- you have to look up the type of the first argument.
IMHO, it would be better to merge the two functions (that take a const char*) and add a 3rd argument:
bool isEncoded
that explicitly specifies whether the data is encoded or not. This API change should be done for Zorba 3.0. Initially assigned to Matthias for later reassignment. |
ItemFactory contains:
Item createBase64Binary(const char* aBinData, size_t aLength) = 0;
Item createBase64Binary(const unsigned char* aBinData, size_t aLength) = 0;
The former expects base64-encoded data; the latter expected raw binary data that is then encoded. IMHO, the distinction between char* and unsigned char* is too subtle. You can't tell by looking at a call to either function whether it's calling the first or second -- you have to look up the type of the first argument.
IMHO, it would be better to merge the two functions (that take a const char*) and add a 3rd argument:
bool isEncoded
that explicitly specifies whether the data is encoded or not. This API change should be done for Zorba 3.0. Initially assigned to Matthias for later reassignment. |
|