|
From: Foster B. <fos...@us...> - 2005-04-19 23:05:14
|
Update of /cvsroot/adobe-source/sandbox/visual_refactor/adobe/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv782/adobe/source Modified Files: xstr.cpp Log Message: hex codes work in xml escape sequences now Index: xstr.cpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/visual_refactor/adobe/source/xstr.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** xstr.cpp 19 Apr 2005 20:59:32 -0000 1.2 --- xstr.cpp 19 Apr 2005 23:05:04 -0000 1.3 *************** *** 556,571 **** /*************************************************************************************************/ ! void translate_char(std::string& content, const char* first, const char* last) { ! std::string char_ref(first, last); ! ! if (char_ref[2] == 'x') ! { ! // REVISIT (fbrereto) : Process hex digits ! } ! else ! { ! content += std::string::value_type(std::atoi(first + 2)); ! } } --- 556,562 ---- /*************************************************************************************************/ ! void translate_char(double code, std::string& content) { ! content += std::string::value_type(code); } *************** *** 601,604 **** --- 592,596 ---- node_t cur_node; std::string cur_content; + double cur_num; // NOTE (fbrereto) : Naming conventions for these rules should follow XML 1.1 spec: *************** *** 808,812 **** reference = entity_ref[boost::bind(translate_entity, boost::ref(cur_content), _1, _2)] ! | char_ref[boost::bind(translate_char, boost::ref(cur_content), _1, _2)] ; --- 800,804 ---- reference = entity_ref[boost::bind(translate_entity, boost::ref(cur_content), _1, _2)] ! | char_ref[boost::bind(translate_char, boost::ref(cur_num), boost::ref(cur_content))] ; *************** *** 818,823 **** char_ref ! = "&#" >> +boost::spirit::digit_p >> ';' ! | "&#x" >> +boost::spirit::xdigit_p >> ';' ; --- 810,815 ---- char_ref ! = "&#" >> boost::spirit::uint_p[boost::spirit::assign_a(cur_num)] >> ';' ! | "&#x" >> boost::spirit::hex_p[boost::spirit::assign_a(cur_num)] >> ';' ; |