fix deprecation warning
This commit is contained in:
parent
476e65e921
commit
5ab59c860d
1 changed files with 6 additions and 1 deletions
|
@ -180,17 +180,22 @@ public:
|
|||
{
|
||||
// TODO: Enum value strings with underscore are deprecated in Mapnik 3.x
|
||||
// and support will be removed in Mapnik 4.x.
|
||||
bool deprecated = false;
|
||||
std::string str_copy(str);
|
||||
if (str_copy.find('_') != std::string::npos)
|
||||
{
|
||||
std::replace(str_copy.begin(), str_copy.end(), '_', '-');
|
||||
MAPNIK_LOG_ERROR(enumerations) << "enumeration value (" << str << ") using \"_\" is deprecated and will be removed in Mapnik 4.x, use '" << str_copy << "' instead";
|
||||
deprecated = true;
|
||||
}
|
||||
for (unsigned i = 0; i < THE_MAX; ++i)
|
||||
{
|
||||
if (str_copy == our_strings_[i])
|
||||
{
|
||||
value_ = static_cast<ENUM>(i);
|
||||
if (deprecated)
|
||||
{
|
||||
MAPNIK_LOG_ERROR(enumerations) << "enumeration value (" << str << ") using \"_\" is deprecated and will be removed in Mapnik 4.x, use '" << str_copy << "' instead";
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue