question

Upvotes
Accepted
10 2 6 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.

Hello @ming.cheng

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?


If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.

Thanks,


AHS

@ming.cheng

Hi,

Please be informed that a reply has been verified as correct in answering the question, and marked as such.

Thanks,

AHS

1 Answer

· Write an Answer
Upvotes
Accepted
78.6k 248 52 74

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