00001
00006 #include <stdexcept>
00007
00008 template<typename C>
00009 inline bool Utilitarios::eImprimivel(C const caractere)
00010 {
00011 try {
00012 std::locale const portugal("pt_PT");
00013
00014 return std::isprint(caractere, portugal);
00015 } catch(std::runtime_error&) {
00016
00017
00018 return true;
00019 }
00020 }
00021
00022 template<typename C>
00023 inline bool Utilitarios::eImprimivel(std::basic_string<C> const& cadeia)
00024 {
00025 using namespace std;
00026
00027 try {
00028 locale const portugal("pt_PT");
00029
00030 return (use_facet<ctype<C> >(portugal).scan_not(ctype_base::print,
00031 cadeia.c_str(),
00032 cadeia.c_str() +
00033 cadeia.length()) ==
00034 cadeia.c_str() + cadeia.length());
00035 } catch(runtime_error&) {
00036
00037
00038 return true;
00039 }
00040
00041 }