dimanche 13 mai 2018

C++ Dynamic formatted string building like using sprintf form dynamic json array

I am trying to develop string parser that decodes and encodes between JSON and string format.

User will send random format like "T:23.%d.%d:test:%s,%d:%f:%s:%d" (All letters and %'s may change. %8d, .%%d etc.) and also send unknown string "T:23.59.59:test:TESTTEST,55:5.20:TTT:89". Both format and string will be received at once. I need to parse received unknown string using received format.

And after some process, i will send format and string back in JSON format.

I need to implement this with a cheap way like using sprintf etc..

Any suggesstions will be appreciated.

Aucun commentaire:

Enregistrer un commentaire