I was wondering if there are NSData, NSDictionary and NSArray equivalents in C++ libraries, And if not, are there any known popular frameworks that provides these classes?
Regards
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
STL has maps that can be used instead of NSDictionary and vectors that can be used instead of NSArray, but of course the “conversion” is not painless, since specific features may be missing and need some more coding. E.g. to “emulate” the selector
dictionaryWithContentsOfURL:for the NSDictionary, you will need extra coding in C++, to parse the URL, and —if it is a remote resource— to connect and retrieve it, and then to unserialize data; other libraries may help of course (boost?), but the point is that if you need to port some special features of NSDictionary (and the others), you need to write more code.On the other hand, if you use only basic dictionary and array feature, the “conversion” can become rather trivial.
Similar argument for NSData, which maybe can be “emulated” by
std::stringbuf.You can also use GNUstep libraries; GNUstep is a GNU open Cocoa framework that provides almost all you have on Cocoa (AppKit and Foundation classes); GNUstep exists for other platforms than Apple Mac OS X, so you can port Cocoa apps on those platforms. Using Objective-C++ you can use both STL and Cocoa/GNUstep framework, and exploit the best of the two worlds (with limits on OO programming and “interactions” between classes/objects of different “origin”), theoretically (I’ve never tried such a mixture, but paying attention is possible to have some benefits, maybe)