Monty Taylor kirjoitti:
> Monty Taylor wrote:
>
>> Maybe we should load the data dictionary at initialization time and have
>> our wrappers for equal and setValue for char* types do a lookup in the
>> data dictionary on the column type and either space pad char columns or
>> add length to the varchar columns. That could all be done once in C++ in
>> the swig file and taken advantage of by all the languages. Sound
>> reasonable?
Using the datadict sounds good. I could imagine taking much more
advantage of it for scripting languages in general: create a single
NdbRecAttr::value() as well which returns the correct target language
type for the underlying database type (including making strings out of
aRef() and get_size_in_bytes()).
> + memcpy(theModifiedValue,theValue,strlen(theValue));
I would like to pass in the length instead of strlen. This will make it
possible to use with binary data which may include nulls. Most of the
target languages already keep the length. I don't know if there's a nice
way to split the string into data and length in SWIG or whether you need
a small language-specific wrapper for that bit.
>
> I haven't really tested this yet - but I thought I'd get some thoughts
> on this approach before going to far. What do you think? If you want to
> avoid the switch, you can just use setValueRaw.
I second keeping the raw interface available.
Mika