Commit 5b82e659 authored by Cédric Traizet's avatar Cédric Traizet

ENH: removed version_proxy::SyncToDisk() method and replaced it with FlushCache()

parent a2d10187
......@@ -477,8 +477,6 @@ public:
}
/** Flushes all changes to disk.
* \throw itd::ExceptionObject in case the flush operation failed.
* \sa \c GDALDataset::SyncToDisk()
*/
void SyncToDisk();
......
......@@ -140,20 +140,6 @@ namespace version_proxy
OTBGdalAdapters_EXPORT
std::string GetDriverNameFromDataSource(const GDALDatasetType * ds);
/**
* Sync dataset to disk.
*
* Calls OGRDataSource::SyncToDisk() for gdal 1.x implementation and
* GDALDataset::FlushCache() for gdal 2.x implementation.
*
* \param dataset Pointer to the dataset to sync. Will not be
* checked for null pointer.
*
* \return True if sync went on without any error.
*/
OTBGdalAdapters_EXPORT
bool SyncToDisk(GDALDatasetType * dataset);
/**
* Return the list of files composing the dataset.
*
......
......@@ -780,13 +780,7 @@ bool otb::ogr::DataSource::HasCapability(std::string const& capabilityName) cons
void otb::ogr::DataSource::SyncToDisk()
{
assert(m_DataSource && "Datasource not initialized");
bool ret = otb::ogr::version_proxy::SyncToDisk(m_DataSource);
if(!ret)
{
itkExceptionMacro( << "Cannot flush the pending of the OGRDataSource <"
<< GetDatasetDescription() << ">: " << CPLGetLastErrorMsg());
}
m_DataSource->FlushCache();
}
......
......@@ -180,17 +180,6 @@ std::vector<std::string> GetFileListAsStringVector(GDALDatasetType * dataset)
return ret;
}
bool SyncToDisk(GDALDatasetType * dataset)
{
#if GDAL_VERSION_NUM<2000000
const OGRErr res= dataset->SyncToDisk();
return (res == OGRERR_NONE);
#else
dataset->FlushCache();
return true;
#endif
}
std::vector<std::string> GetAvailableDriversAsStringVector()
{
std::vector<std::string> ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment