Мне нужно соединить два API, которые используют разные структуры для описания файлов. Один предоставляет мне std::FILE*, а второй ожидает, что GFile* или GInputStream* принадлежит GIO. Есть ли простой способ создать любой объект из необработанного указателя файла, который я получаю?
void my_function(std::FILE * file) {
GFile * gfile = some_creator_method(file);
//or alternatively
GInputStream * ginput = some_stream_creator_method(file);
//...
//pass the GFile to the other library interface
//either using:
interface_function(gfile);
//or using
interface_stream_function(ginput);
}
//The interface function signatures I want to pass the parameter to:
void interface_function(GFile * f);
void interface_stream_function(GInputStream * is);
Подробнее здесь: https://stackoverflow.com/questions/639 ... om-stdfile