question

Upvotes
Accepted
3 0 0 2

How to convert EmaString to std::string

Does anyone know how to convert it?Thx

elektronrefinitiv-realtimeelektron-sdkema-apirrtelektron-message-api
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 @jason.ng,

Thank you for your participation in the forum.

Is the reply below satisfactory in resolving your query? If yes please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

-AHS

@jason.ng

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

1 Answer

· Write an Answer
Upvotes
Accepted
7.6k 15 6 9

@jason.ng

You can just simply calls EmaString::c_str() to return buffer as const char* and then you can use string::append() to add the buffer from EmaString to std::string.

For example,

EmaString hostname="localhost:14002";
std::string host;
host.append(hostname.c_str());
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.

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.