Update of /cvsroot/boost/boost/boost/regex/v4
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2002/boost/regex/v4
Modified Files:
regex_format.hpp
Log Message:
Fixed Perl style formatting with \l and \u.
Index: regex_format.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/regex/v4/regex_format.hpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- regex_format.hpp 27 Jan 2006 10:35:04 -0000 1.15
+++ regex_format.hpp 19 Mar 2007 13:20:26 -0000 1.16
@@ -75,7 +75,7 @@
public:
typedef typename traits::char_type char_type;
basic_regex_formatter(OutputIterator o, const Results& r, const traits& t)
- : m_traits(t), m_results(r), m_out(o), m_state(output_copy),
m_have_conditional(false) {}
+ : m_traits(t), m_results(r), m_out(o), m_state(output_copy),
m_restore_state(output_copy), m_have_conditional(false) {}
OutputIterator format(const char_type* p1, const char_type* p2,
match_flag_type f);
OutputIterator format(const char_type* p1, match_flag_type f)
{
@@ -108,6 +108,7 @@
const char_type* m_end; // format string end
match_flag_type m_flags; // format flags to use
output_state m_state; // what to do with the next character
+ output_state m_restore_state; // what state to restore to.
bool m_have_conditional; // we are parsing a conditional
private:
basic_regex_formatter(const basic_regex_formatter&);
@@ -362,6 +363,7 @@
{
case 'l':
++m_position;
+ m_restore_state = m_state;
m_state = output_next_lower;
breakout = true;
break;
@@ -372,6 +374,7 @@
break;
case 'u':
++m_position;
+ m_restore_state = m_state;
m_state = output_next_upper;
breakout = true;
break;
@@ -495,11 +498,11 @@
return;
case output_next_lower:
c = m_traits.tolower(c);
- this->m_state = output_copy;
+ this->m_state = m_restore_state;
break;
case output_next_upper:
c = m_traits.toupper(c);
- this->m_state = output_copy;
+ this->m_state = m_restore_state;
break;
case output_lower:
c = m_traits.tolower(c);
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs