I want to call a c++ function in swift
bool getId3Info(const char * filename , char *artist , char * title )
{
// get the file's id3v2 tag, write info back
strcpy(artist,(const char*) id3v2tag->artist().toCString(true));
strcpy(title,id3v2tag->title().toCString(true));
}
So I write a object-c wrapper for this function:
-(bool) getId3Info:(const char * )filename :( const char *)artist :( const char *) title
{
return getId3Info(filename, (char*)artist, (char*)title);
}
So the questions is I can only get the representation of a C string using cStringUsingEncoding
,
can not get the true buffer of a swift String
,
is there another way to do this?