[Q] Extracting the key members of an XmlRpcValue object (C++)

M

mtp1032

I need to be able to extract the values from an XmlRpcValue where I do
not know in advance what the keys are, or how many exist. For example,
suppose I have an XmlRpcValue, xmlVal, returned by some xml-rpc method,


XmlRpc::XmlRpcValue xmlVal = some_xmlrpc_method(...);
std::cout << xmlVal << std::endl;


yields the following:


{
eventType: "BIRTH",
mother: "Michelle",
gender: "MALE"
}


Knowing the keys (i.e., 'eventType', 'mother', and 'gender') extracting
the value (i.e., "BIRTH", "Michelle", or "MALE") is straightfoward.
However, suppose I do not know what are the keys? What code could write
to obtain key for each member? In other words, what code do implement
that, when executed, will return the string "eventType", "mother", or
"gender".

Thanks, in advance,

Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top