22 #include "base/Optionpk.h"
25 template<>
inline std::string string2type(std::string
const& s){
30 template<>
inline OGRFieldType string2type(std::string
const& s){
33 for(
int iType = 0; iType < ogr_typecount; ++iType){
34 if( OGRFieldDefn::GetFieldTypeName((OGRFieldType)iType) != NULL
35 && EQUAL(OGRFieldDefn::GetFieldTypeName((OGRFieldType)iType),s.c_str()))
36 ftype=(OGRFieldType) iType;
42 template<>
inline std::string type2string(
bool const& value){
50 template<>
inline std::string type2string(std::string
const& value){
58 template<>
inline std::string type2string(
float const& value){
59 std::ostringstream oss;
67 template<>
inline std::string type2string(
double const& value){
68 std::ostringstream oss;
76 template<>
inline void Optionpk<bool>::setAll(
const std::string& shortName,
const std::string& longName,
const std::string& helpInfo);
78 template<>
inline void Optionpk<bool>::setAll(
const std::string& shortName,
const std::string& longName,
const std::string& helpInfo)
80 m_shortName=shortName;
88 template<>
inline void Optionpk<bool>::setAll(
const std::string& shortName,
const std::string& longName,
const std::string& helpInfo,
const bool& defaultValue,
short hide);
91 template<>
inline void Optionpk<bool>::setAll(
const std::string& shortName,
const std::string& longName,
const std::string& helpInfo,
const bool& defaultValue,
short hide)
93 m_shortName=shortName;
97 m_defaultValue=defaultValue;
103 template<>
inline Optionpk<bool>::Optionpk(
const std::string& shortName,
const std::string& longName,
const std::string& helpInfo,
const bool& defaultValue,
short hide)
105 setAll(shortName,longName,helpInfo,defaultValue, hide);
111 std::vector<std::string>::const_iterator opit=this->begin();
112 while(opit!=this->end()){
113 if(opit->find(argument)!=std::string::npos)
Optionpk()
default constructor
std::vector< T >::const_iterator findSubstring(const T &argument) const
void setAll(const std::string &shortName, const std::string &longName, const std::string &helpInfo)
set all attributes of the option, except default and hide