Skip to content
Snippets Groups Projects
Commit cdaf666c authored by Antoine Regimbeau's avatar Antoine Regimbeau
Browse files

ENH: prepare the OGR extended filename service

parent 99723cb9
No related branches found
No related tags found
1 merge request!24Handle extended filename for DataSource class
Showing
with 199 additions and 6 deletions
/*
* Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef otbOGRExtendedFilenameToReaderOptions_h
#define otbOGRExtendedFilenameToReaderOptions_h
#include <set>
#include "otbExtendedFilenameHelper.h"
namespace otb
{
/** \class OGRExtendedFilenameToReaderOptions
*/
class ITK_EXPORT OGRExtendedFilenameToReaderOptions : public ExtendedFilenameHelper
{
public:
/** Standard class typedefs. */
typedef OGRExtendedFilenameToReaderOptions Self;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
typedef ExtendedFilenameHelper Superclass;
typedef Superclass::OptionMapType OptionMapType;
typedef OptionMapType::iterator MapIteratorType;
itkTypeMacro(OGRExtendedFilenameToReaderOptions, otb::ExtendedFilenameHelper);
itkNewMacro(Self);
/** The creation option structure. */
struct OptionType
{
std::pair< bool , std::string > simpleFileName;
std::pair< bool , std::string > encoding;
std::set< std::string > availableOptions;
};
/* Set Methods */
void SetExtendedFileName(const char * extFname) override;
protected:
OGRExtendedFilenameToReaderOptions();
~OGRExtendedFilenameToReaderOptions() override {};
private:
OGRExtendedFilenameToReaderOptions(const Self &) = delete ;
void operator =(const Self&) = delete ;
OptionType m_Options;
};
} //end namespace otb
#endif // otbOGRExtendedFilenameToReaderOptions_h
/*
* Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef otbOGRExtendedFilenameToWriterOptions_h
#define otbOGRExtendedFilenameToWriterOptions_h
#include "otbExtendedFilenameHelper.h"
namespace otb
{
/** \class OGRExtendedFilenameToWriterOptions
*/
class ITK_EXPORT OGRExtendedFilenameToWriterOptions : public ExtendedFilenameHelper
{
public:
};
} //end namespace otb
#endif // otbOGRExtendedFilenameToWriterOptions_h
\ No newline at end of file
......@@ -29,6 +29,8 @@ set(OTBGdalAdapters_SRC
otbGeometriesToGeometriesFilter.cxx
otbOGRDataSourceWrapper.cxx
otbOGRVersionProxy.cxx
otbOGRExtendedFilenameToReaderOptions.cxx
otbOGRExtendedFilenameToWriterOptions.cxx
)
add_library(OTBGdalAdapters ${OTBGdalAdapters_SRC})
......
/*
* Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "otbOGRExtendedFilenameToReaderOptions.h"
namespace otb
{
OGRExtendedFilenameToReaderOptions::
OGRExtendedFilenameToReaderOptions()
{
m_Options.simpleFileName.first = false;
m_Options.simpleFileName.second = "";
m_Options.encoding.first = false;
m_Options.encoding.second = "";
m_Options.availableOptions.insert("encoding");
}
void
OGRExtendedFilenameToReaderOptions::
SetExtendedFileName(const char *extFname)
{
Superclass::SetExtendedFileName(extFname);
OptionMapType map = GetOptionMap();
m_Options.simpleFileName.first = true;
m_Options.simpleFileName.second = this->GetSimpleFileName();
}
} //end namespace otb
/*
* Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "otbOGRExtendedFilenameToReaderOptions.h"
namespace otb
{
} //end namespace otb
\ No newline at end of file
......@@ -23,6 +23,7 @@
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "OTBCommonExport.h"
namespace otb
{
......@@ -35,7 +36,7 @@ namespace otb
* \ingroup OTBExtendedFilename
*/
class ITK_EXPORT ExtendedFilenameHelper : public itk::Object
class OTBCommon_EXPORT ExtendedFilenameHelper : public itk::Object
{
public:
/** Standard class typedefs. */
......
......@@ -27,6 +27,8 @@ ENABLE_SHARED
OTBITK
#Add dependency to OTBGDAL as GDAL module need to set OTB_USE_GDAL_20 before configuring otbConfigure.h
OTBGDAL
#Add dependency for extended filename helper class
OTBBoostAdapters
TEST_DEPENDS
OTBImageBase
......
......@@ -29,12 +29,12 @@ set(OTBCommon_SRC
otbWriterWatcherBase.cxx
otbStopwatch.cxx
otbStringToHTML.cxx
otbExtendedFilenameHelper.cxx
)
add_library(OTBCommon ${OTBCommon_SRC})
target_link_libraries(OTBCommon
${OTBITK_LIBRARIES}
)
otb_module_target(OTBCommon)
......@@ -26,8 +26,8 @@ product by skipping either geographic or sensor-model information.")
otb_module(OTBExtendedFilename
DEPENDS
OTBCommon
OTBIOGDAL
OTBBoostAdapters
OTBITK
TEST_DEPENDS
......
......@@ -20,15 +20,13 @@
set(OTBExtendedFilename_SRC
otbExtendedFilenameToReaderOptions.cxx
otbExtendedFilenameHelper.cxx
otbExtendedFilenameToWriterOptions.cxx
)
add_library(OTBExtendedFilename ${OTBExtendedFilename_SRC})
target_link_libraries(OTBExtendedFilename
${OTBCommon_LIBRARIES}
${OTBIOGDAL_LIBRARIES}
${OTBBoost_LIBRARIES}
)
otb_module_target(OTBExtendedFilename)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment