question

Upvotes
Accepted
10 2 7 9

RFA 8.0 C++ DataBuffer fields handling

There are these field types:

StringUTF8Enum/StringAsciiEnum/StringRMTESEnum. Can I call getAsString() for all of them if I don't care UNICODE issue?

#technology#productrfa-apic++
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvotes
Accepted
83.1k 281 53 77

@ming.cheng

Thanks for reaching out to us.

For a general usage, it is better to refer to the code used in the example.

        case DataBuffer::StringAsciiEnum:
        case DataBuffer::StringUTF8Enum:
        case DataBuffer::StringRMTESEnum:
        case DataBuffer::XMLEnum:
        {
            const Buffer& buf = dataBuffer.getBuffer();
            sData = new char[buf.size() + 1];


            strncpy( sData, (char*)buf.c_buf(), buf.size() );
            sData[ buf.size() ] = '\0';
            write( "\"%s\"", sData );


            delete[] sData;
        }

I hope that this information is of help.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

It's beyond my expectations. Very helpful.

this write function is supposed to be user's function?

Yes, it is a user-defined function in the RFA examples.

void StandardOut::write(const char* input, ...)
{
    va_list arglist;
    assert( input != NULL );
    va_start( arglist, input );


    vprintf( input, arglist );

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.