#ifndef ARABICA_XML_STRINGS_HPP #define ARABICA_XML_STRINGS_HPP #include #include namespace Arabica { namespace XML { bool is_ncname(const std::string& str) { using namespace Arabica::text; std::string::const_iterator s = str.begin(); if(!(is_letter(*s) || (*s == Unicode::LOW_LINE))) return false; ++s; for(std::string::const_iterator se = str.end(); s != se; ++s) { wchar_t c = static_cast(*s); if(!(is_letter(c) || is_digit(c) || (c == Unicode::FULL_STOP) || (c == Unicode::HYPHEN_MINUS) || (c == Unicode::LOW_LINE) || is_combining_char(c) || is_extender(c))) return false; } return true; } // is_ncname } // namespace XML } // namespace Arabica #endif