Implemented feature request ID: 2515238; renamed an internal enum to avoid conflicts with macros from other libraries

git-svn-id: http://svn.code.sf.net/p/utfcpp/code@85 a809a056-fc17-0410-9590-b4f493f8b08e
This commit is contained in:
ntrifunovic 2009-03-14 17:19:41 +00:00
parent c92c41770d
commit 76c6662ef9
2 changed files with 42 additions and 42 deletions

View file

@ -72,7 +72,7 @@ namespace utf8
octet_iterator sequence_start = start;
internal::utf_error err_code = internal::validate_next(start, end);
switch (err_code) {
case internal::OK :
case internal::UTF8_OK :
for (octet_iterator it = sequence_start; it != start; ++it)
*out++ = *it;
break;
@ -138,7 +138,7 @@ namespace utf8
uint32_t cp = 0;
internal::utf_error err_code = internal::validate_next(it, end, &cp);
switch (err_code) {
case internal::OK :
case internal::UTF8_OK :
break;
case internal::NOT_ENOUGH_ROOM :
throw not_enough_room();

View file

@ -100,7 +100,7 @@ namespace internal
return 0;
}
enum utf_error {OK, NOT_ENOUGH_ROOM, INVALID_LEAD, INCOMPLETE_SEQUENCE, OVERLONG_SEQUENCE, INVALID_CODE_POINT};
enum utf_error {UTF8_OK, NOT_ENOUGH_ROOM, INVALID_LEAD, INCOMPLETE_SEQUENCE, OVERLONG_SEQUENCE, INVALID_CODE_POINT};
template <typename octet_iterator>
utf_error validate_next(octet_iterator& it, octet_iterator end, uint32_t* code_point)
@ -116,7 +116,7 @@ namespace internal
if (code_point)
*code_point = cp;
++it;
return OK;
return UTF8_OK;
}
else
return NOT_ENOUGH_ROOM;
@ -210,7 +210,7 @@ namespace internal
}
++it;
return OK;
return UTF8_OK;
}
template <typename octet_iterator>
@ -231,7 +231,7 @@ namespace internal
octet_iterator result = start;
while (result != end) {
internal::utf_error err_code = internal::validate_next(result, end);
if (err_code != internal::OK)
if (err_code != internal::UTF8_OK)
return result;
}
return result;