azadkuh / gason--

an efficient JSon parser and builder in plain C++
Other
25 stars 13 forks source link

can JsonValue support std::string #1

Closed qicosmos closed 9 years ago

azadkuh commented 9 years ago

gason++ is mostly suitable for small embedded systems where HEAP allocation is quite expensive or needs special consideration. the whole STL is aroundnew/delete (HEAP allocations). so std::string / std::list / ... are not top priority in such libraries.

gason++ reuse the parsed memory an it's very RAM friendly. it means that the original json data won't be copied at parsing and the memory allocations will be reused for next parsings.

by the way using std::string is quite easy and it's highly recommended if you like STL, thanks to std::string's ctors and operator=() overloads.

// gason++ & std::string
std::string message = root["a_message"].toString(&ok);

please keep in mind that std::string message makes a copy from the original data.