Beispiel #1
0
void* CAddonCallbacksAddon::CURLCreate(const void* addonData, const char* strURL)
{
  CAddonInterfaces* helper = (CAddonInterfaces*)addonData;
  if (!helper)
    return nullptr;

  CFile* file = new CFile;
  if (file->CURLCreate(strURL))
    return ((void*)file);

  delete file;

  return nullptr;
}
Beispiel #2
0
void* Interface_Filesystem::curl_create(void* kodiBase, const char* url)
{
  CAddonDll* addon = static_cast<CAddonDll*>(kodiBase);
  if (addon == nullptr || url == nullptr)
  {
    CLog::Log(LOGERROR, "Interface_Filesystem::%s - invalid data (addon='%p', url='%p')", __FUNCTION__, kodiBase, url);
    return nullptr;
  }

  CFile* file = new CFile;
  if (file->CURLCreate(url))
    return static_cast<void*>(file);

  delete file;
  return nullptr;
}