Hi, I'm creating a shared library, and I need to know how to create a "C" interface to OFList<OFString>.
Is there a way to convert, for example a "const char *" to OFList<OFString> ?
Thanks in advance.
OFList<OFString> in "C"
Moderator: Moderator Team
-
- DCMTK Developer
- Posts: 2049
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
-
- Posts: 347
- Joined: Mon, 2009-02-23, 19:57
-
- Posts: 347
- Joined: Mon, 2009-02-23, 19:57
For those insterested in the subject, this is the smallest algorithm I come up with:
Code: Select all
// overrideKeys is a const char * received as a param
// lOverrideKeys is an OFList<OFString>
std::string s1(overrideKeys);
std::istringstream iss(s1);
std::string s2;
while( std::getline( iss, s2, '\n' ) )
{
OFString word(s2.c_str());
lOverrideKeys.push_back(word);
}
Who is online
Users browsing this forum: Bing [Bot] and 1 guest