/usr/include/OTB-5.8/otbOGRVersionProxy.h is in libotb-dev 5.8.0+dfsg-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | /*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef otbOGRVersionProxy_h
#define otbOGRVersionProxy_h
#include <string>
#include <vector>
#include "otbConfigure.h"
#include "itkMacro.h"
#ifdef OTB_USE_GDAL_20
class GDALDataset;
class GDALDriver;
#else
class OGRDataSource;
class OGRSFDriver;
#endif
#include "OTBGdalAdaptersExport.h"
namespace otb
{
namespace ogr
{
namespace version_proxy
{
/**
* This namespace holds proxy functions hiding interface changes in gdal 2.0
*
* This namespace holds proxy functions hiding interface changes in OGR
* dataset between gdal 1.x (x>10) and gdal 2.x. It defines a common
* interface that should be used in place of calling directly the
* wrapped gdal functions.
*
* Whenever GDALDataset and GDALDriver have to be used to open a
* vector dataset (or OGRDataSource an OGRSFDriver for gdal 1.x), one
* should use ogr::version_proxy types GDALDatasetType and
* GDALDriverType.
*
* See function documentation for details.
*/
#ifdef OTB_USE_GDAL_20
typedef GDALDataset GDALDatasetType;
typedef GDALDriver GDALDriverType;
#else
typedef OGRDataSource GDALDatasetType;
typedef OGRSFDriver GDALDriverType;
#endif
/**
* This function opens a file, possibly in read-only mode, and returns
* a dataset.
*
* Calls OGRSFDriverRegistrar::Open for gdal 1.x implementation and GDALopenEx for
* gdal 2.x implementation.
* \param filename Filename of the file to open
* \param readOnly: If true, dataset is open in read-only mode.
* \return NULL if file could not be open.
*/
OTBGdalAdapters_EXPORT
GDALDatasetType * Open(const char * filename, bool readOnly = true);
/**
* This function closes a dataset.
*
* Calls OGRDataSource::DestroyDataSource for gdal 1.x
* implementation and GDALClose for gdal 2.x implementation.
*
* \param dataset Pointer to the dataset to close. Will not be
* checked for null pointer.
*/
OTBGdalAdapters_EXPORT
void Close(GDALDatasetType * dataset);
/**
* This function creates a new dataset.
*
* Calls OGRSFDriver::CreateDataSource for gdal 1.x implementation
* and GDALDriver::Create with (0,0) raster size for gdal 2.x
* implementation
*
* \param driver Pointer to the driver used for creation. Will not
* be checked for null pointer.
*
* \param name Name of the dataset to create.
*
* \return NULL if dataset could not be created.
*/
OTBGdalAdapters_EXPORT
GDALDatasetType * Create(GDALDriverType * driver, const char * name);
/**
* This function physically deletes an existing dataset.
*
* Calls OGRDataSource::DeleteDataSource for gdal 1.x implementation
* and GDALDriver::Delete for gdal 2.x implementation.
*
* \param name Name of the dataset to destroy.
*/
OTBGdalAdapters_EXPORT
bool Delete(const char * name);
/**
* This function returns a pointer to the driver from its name.
*
* Calls OGRSFDriverRegistrar::GetRegistrar()->GetDriverByName() for
* gdal 1.x implementation and
* GetGDALDriverManager()->GetDriverByName() for gdal 2.x
* implementation.
*
* \param name Name of the driver to retrieve
*
* \return NULL if no driver could be retrieved.
*/
OTBGdalAdapters_EXPORT
GDALDriverType * GetDriverByName(const char * name);
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 name of the dataset class behind the implementation
* (OGRDataSource for gdal 1.x and GdalDataset for gdal 2.x)
*/
OTBGdalAdapters_EXPORT
std::string GetDatasetClassName();
/**
* \return The name of the driver class behind the implementation
* (OGRSFDriver for gdal 1.x and GDALDriver for gdal 2.x)
*/
OTBGdalAdapters_EXPORT
std::string GetDriverClassName();
/**
* Return the list of files composing the dataset.
*
* Calls OGRDataSource::GetName() and wrap in string vector for gdal
* 1.x implementation, and GDALDataset::GetFileList and wrap in
* string vector for gdal 2.x implementation.
*
* \param dataset Pointer to the dataset to get the file list from. Will not be
* checked for null pointer.
*
* \return A vector of string containing the list of files.
*/
OTBGdalAdapters_EXPORT
std::vector<std::string> GetFileListAsStringVector(GDALDatasetType * dataset);
/**
* Return the list of available drivers.
*
* Calls OGRSFDriverRegistrar::GetRegistrar() for gdal 1.x
* implementation and GetGDALDriverManager() for gdal 2.x
* implementation.
*
* \return A vector of string containing the list of available drivers.
*/
OTBGdalAdapters_EXPORT
std::vector<std::string> GetAvailableDriversAsStringVector();
}
}
} // end namespace otb
#endif
|