diff options
author | Luboš Doležel <lubos@dolezel.info> | 2015-07-04 22:11:12 +0200 |
---|---|---|
committer | Luboš Doležel <lubos@dolezel.info> | 2015-07-04 22:11:12 +0200 |
commit | 4ec69237e6b777df818bc95bd46a58448340b30d (patch) | |
tree | c08584cb8cd034d071f476372ceb6de44447fa6c /src/mwi | |
parent | 636331cbf0e0d0947f5d25771c5a0689f07564fd (diff) | |
download | twinkle-4ec69237e6b777df818bc95bd46a58448340b30d.tar twinkle-4ec69237e6b777df818bc95bd46a58448340b30d.tar.gz twinkle-4ec69237e6b777df818bc95bd46a58448340b30d.tar.lz twinkle-4ec69237e6b777df818bc95bd46a58448340b30d.tar.xz twinkle-4ec69237e6b777df818bc95bd46a58448340b30d.zip |
Replaced Boost regex dependency with C++11 regex
Diffstat (limited to 'src/mwi')
-rw-r--r-- | src/mwi/simple_msg_sum_body.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mwi/simple_msg_sum_body.cpp b/src/mwi/simple_msg_sum_body.cpp index 33683f7..1d20609 100644 --- a/src/mwi/simple_msg_sum_body.cpp +++ b/src/mwi/simple_msg_sum_body.cpp @@ -20,7 +20,7 @@ #include <iostream> #include <cstdlib> -#include <boost/regex.hpp> +#include <regex> #include "protocol.h" #include "util.h" @@ -43,20 +43,20 @@ bool t_msg_summary::parse(const string &s) { // msg-summary-line = message-context-class HCOLON newmsgs SLASH oldmsgs // [ LPAREN new-urgentmsgs SLASH old-urgentmsgs RPAREN ] // This regex matches the part after HCOLON - boost::regex re("(\\d+)\\s*/\\s*(\\d+)(?:\\s*\\((\\d+)\\s*/\\s*(\\d+)\\s*\\))?"); + std::regex re("(\\d+)\\s*/\\s*(\\d+)(?:\\s*\\((\\d+)\\s*/\\s*(\\d+)\\s*\\))?"); - boost::smatch m; - if (!boost::regex_match(s, m, re)) return false; + std::smatch m; + if (!std::regex_match(s, m, re)) return false; if (m.size() == 3) { - newmsgs = strtoul(m.str(1).c_str(), NULL, 10); - oldmsgs = strtoul(m.str(2).c_str(), NULL, 10); + newmsgs = std::stoul(m.str(1), NULL, 10); + oldmsgs = std::stoul(m.str(2), NULL, 10); return true; } else if (m.size() == 5) { - newmsgs = strtoul(m.str(1).c_str(), NULL, 10); - oldmsgs = strtoul(m.str(2).c_str(), NULL, 10); - newmsgs_urgent = strtoul(m.str(3).c_str(), NULL, 10); - oldmsgs_urgent = strtoul(m.str(4).c_str(), NULL, 10); + newmsgs = std::stoul(m.str(1), NULL, 10); + oldmsgs = std::stoul(m.str(2), NULL, 10); + newmsgs_urgent = std::stoul(m.str(3), NULL, 10); + oldmsgs_urgent = std::stoul(m.str(4), NULL, 10); return true; } |