createBase64Binary() API too subtle

Bug #1158052 reported by Paul J. Lucas on 2013-03-21
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
Medium
Paul J. Lucas

Bug 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.

Related branches

description: updated
Changed in zorba:
assignee: Matthias Brantner (matthias-brantner) → Paul J. Lucas (paul-lucas)
Changed in zorba:
status: New → In Progress
Changed in zorba:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers