Can I always call getAsString() to a DataBuffer object?
Assume the actual DataBuffer type is Time or DateTime. How will a value got by getAsString() look like?
New posts are disabled while we improve the user experience.
You can browse the site, or for urgent issues, raise a query at MyAccount.
Thanks for reaching out to us.
Yes, it will get a string of that date or time.
FieldEntry [ 79] HSTCLSDATE GetAsString(): 16 FEB 2023 2/16/2023 ... FieldEntry [ 287] LOW_TIME GetAsString(): 08:08:37:000:000:000 8:8:37
The following is the description of this method.
const rfa::common::RFA_String& rfa::data::DataBuffer::getAsString() const Returns select types that are converted to a string representation. The associated set methods converts select types from a string representation. Invalid types include XMLEnum, OpaqueEnum, ANSI_PageEnum
The code looks like this:
case DataBuffer::DateEnum: printf("\nGetAsString(): %s\n", dataBuffer.getAsString().c_str()); _out->out(dataBuffer.getDate()); break; case DataBuffer::TimeEnum: printf("\nGetAsString(): %s\n", dataBuffer.getAsString().c_str()); _out->out(dataBuffer.getTime()); break;
I hope that this information is of help.
So for type XMLEnum, OpaqueEnum, ANSI_PageEnum, user can't call getAsString(). It's ok for the rest.