remove dead code in enumeration.hpp

This commit is contained in:
Dane Springmeyer 2016-02-02 12:35:06 -08:00
parent 09f137796d
commit 1600bfe981

View file

@ -203,57 +203,12 @@ public:
str + "' for enum " + our_name_); str + "' for enum " + our_name_);
} }
/** Parses the input stream @p is for a word consisting of characters and
* digits (<i>a-z, A-Z, 0-9</i>) and underscores (<i>_</i>).
* The failbit of the stream is set if the word is not a valid identifier.
*/
std::istream & parse(std::istream & is)
{
std::string word;
char c;
while ( is.peek() != std::char_traits< char >::eof())
{
is >> c;
if ( std::isspace(c) && word.empty() )
{
continue;
}
if ( std::isalnum(c) || (c == '_') || c == '-' )
{
word += c;
}
else
{
is.unget();
break;
}
}
try
{
from_string( word );
}
catch (illegal_enum_value const&)
{
is.setstate(std::ios::failbit);
}
return is;
}
/** Returns the current value as a string identifier. */ /** Returns the current value as a string identifier. */
std::string as_string() const std::string as_string() const
{ {
return our_strings_[value_]; return our_strings_[value_];
} }
/** Prints the string identifier to the output stream @p os. */
std::ostream & print(std::ostream & os = std::cerr) const
{
return os << our_strings_[value_];
}
/** Static helper function to iterate over valid identifiers. */ /** Static helper function to iterate over valid identifiers. */
static const char * get_string(unsigned i) static const char * get_string(unsigned i)
{ {
@ -284,22 +239,6 @@ public:
return true; return true;
} }
static std::string const& get_full_qualified_name()
{
return our_name_;
}
static std::string get_name()
{
std::string::size_type idx = our_name_.find_last_of(":");
if ( idx == std::string::npos )
{
return our_name_;
} else {
return our_name_.substr( idx + 1 );
}
}
private: private:
ENUM value_; ENUM value_;
static const char ** our_strings_ ; static const char ** our_strings_ ;
@ -307,28 +246,6 @@ private:
static bool our_verified_flag_; static bool our_verified_flag_;
}; };
/** ostream operator for enumeration
* @relates mapnik::enumeration
*/
template <class ENUM, int THE_MAX>
std::ostream &
operator<<(std::ostream & os, const mapnik::enumeration<ENUM, THE_MAX> & e)
{
e.print( os );
return os;
}
/** istream operator for enumeration
* @relates mapnik::enumeration
*/
template <class ENUM, int THE_MAX>
std::istream &
operator>>(std::istream & is, mapnik::enumeration<ENUM, THE_MAX> & e)
{
e.parse( is );
return is;
}
} // end of namespace } // end of namespace
/** Helper macro. /** Helper macro.