OTB  9.0.0
Orfeo Toolbox
Public Member Functions | Public Attributes | List of all members
otb::MetadataSupplierInterface Class Referenceabstract

#include <otbMetadataSupplierInterface.h>

+ Inheritance diagram for otb::MetadataSupplierInterface:
+ Collaboration diagram for otb::MetadataSupplierInterface:

Public Member Functions

template<>
bool GetAs (bool const &defaultValue, std::string const &path, int band) const
 
template<typename T >
GetAs (std::string const &path, int band=-1) const
 
template<typename T >
GetAs (T const &defaultValue, std::string const &path, int band=-1) const
 
template<typename T >
std::vector< T > GetAsVector (std::string const &path, char sep=' ', int size=-1, int band=-1) const
 
virtual unsigned int GetAttributId (std::string const &path, std::string const &value) const =0
 
virtual std::string GetMetadataValue (std::string const &path, bool &hasValue, int band=-1) const =0
 
virtual int GetNbBands () const =0
 
virtual unsigned int GetNumberOf (std::string const &path) const =0
 
virtual std::string GetResourceFile (std::string const &="") const =0
 
virtual std::vector< std::string > GetResourceFiles () const
 
bool HasValue (std::string const &path, int band=-1) const
 
virtual ~MetadataSupplierInterface ()=default
 

Public Attributes

const std::array< std::string, 3 > FALSES = {"0", "false", "False"}
 
const std::array< std::string, 3 > TRUES = {"1", "true", "True"}
 

Detailed Description

Base class to access metadata information in files/images.

Definition at line 40 of file otbMetadataSupplierInterface.h.

Constructor & Destructor Documentation

◆ ~MetadataSupplierInterface()

virtual otb::MetadataSupplierInterface::~MetadataSupplierInterface ( )
virtualdefault

Member Function Documentation

◆ GetAs() [1/3]

template<>
bool otb::MetadataSupplierInterface::GetAs ( bool const &  defaultValue,
std::string const &  path,
int  band 
) const

◆ GetAs() [2/3]

template<typename T >
T otb::MetadataSupplierInterface::GetAs ( std::string const &  path,
int  band = -1 
) const

◆ GetAs() [3/3]

template<typename T >
T otb::MetadataSupplierInterface::GetAs ( T const &  defaultValue,
std::string const &  path,
int  band = -1 
) const

Definition at line 31 of file otbMetadataSupplierInterface.hxx.

References GetMetadataValue().

◆ GetAsVector()

template<typename T >
std::vector< T > otb::MetadataSupplierInterface::GetAsVector ( std::string const &  path,
char  sep = ' ',
int  size = -1,
int  band = -1 
) const

Parse a metadata value to a std::vector, If size>=0, then the final std::vector size is checked and an exception is raised if it doesn't match the given size.

Definition at line 69 of file otbMetadataSupplierInterface.hxx.

References GetMetadataValue(), otb::lstrip(), otbGenericExceptionMacro, otb::rstrip(), and otb::split_on().

◆ GetAttributId()

virtual unsigned int otb::MetadataSupplierInterface::GetAttributId ( std::string const &  path,
std::string const &  value 
) const
pure virtual

If multiple keys have the same path, gives the position of the one with value value

Implemented in otb::XMLMetadataSupplier, otb::GDALImageIO, and otb::GeomMetadataSupplier.

◆ GetMetadataValue()

virtual std::string otb::MetadataSupplierInterface::GetMetadataValue ( std::string const &  path,
bool &  hasValue,
int  band = -1 
) const
pure virtual

Get the metadata value corresponding to a given path (meaning of this path depends on the specific implementation. Returns empty string when path is not found, and hasValue is set to False. If band >= 0, the metadata value is looked in the specified band

Implemented in otb::GeomMetadataSupplier, otb::XMLMetadataSupplier, and otb::GDALImageIO.

Referenced by GetAs(), GetAsVector(), and otb::DimapMetadataHelper::ParseVector().

◆ GetNbBands()

virtual int otb::MetadataSupplierInterface::GetNbBands ( ) const
pure virtual

◆ GetNumberOf()

virtual unsigned int otb::MetadataSupplierInterface::GetNumberOf ( std::string const &  path) const
pure virtual

Get the number of keys starting with path

Implemented in otb::XMLMetadataSupplier, otb::GDALImageIO, and otb::GeomMetadataSupplier.

◆ GetResourceFile()

virtual std::string otb::MetadataSupplierInterface::GetResourceFile ( std::string const &  = "") const
pure virtual

◆ GetResourceFiles()

virtual std::vector<std::string> otb::MetadataSupplierInterface::GetResourceFiles ( ) const
inlinevirtual

Reimplemented in otb::GDALImageIO, and otb::GeomMetadataSupplier.

Definition at line 46 of file otbMetadataSupplierInterface.h.

◆ HasValue()

bool otb::MetadataSupplierInterface::HasValue ( std::string const &  path,
int  band = -1 
) const

Member Data Documentation

◆ FALSES

const std::array<std::string, 3> otb::MetadataSupplierInterface::FALSES = {"0", "false", "False"}

Definition at line 44 of file otbMetadataSupplierInterface.h.

◆ TRUES

const std::array<std::string, 3> otb::MetadataSupplierInterface::TRUES = {"1", "true", "True"}

Definition at line 43 of file otbMetadataSupplierInterface.h.


The documentation for this class was generated from the following files: