diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/call_history.cpp | 6 | ||||
-rw-r--r-- | src/gui/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/gui/numberconversionform.cpp | 4 | ||||
-rw-r--r-- | src/gui/userprofileform.cpp | 4 | ||||
-rw-r--r-- | src/mwi/simple_msg_sum_body.cpp | 20 | ||||
-rw-r--r-- | src/user.cpp | 8 | ||||
-rw-r--r-- | src/user.h | 8 |
8 files changed, 27 insertions, 27 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ec3aa62..b1b0607 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -79,7 +79,7 @@ endif (WITH_QT4 OR WITH_QT5) target_link_libraries(twinkle-console -lpthread -lresolv ${LibMagic_LIBRARY} ${LIBXML2_LIBRARIES} ${Readline_LIBRARY} ${ILBC_LIBRARIES} ${SPEEX_LIBRARIES} ${ZRTPCPP_LIBRARIES} ${CCRTP_LIBRARIES} ${COMMONCPP_LIBRARIES} ${UCOMMON_LIBRARIES} ${LIBSNDFILE_LIBRARY} - ${Boost_LIBRARIES} ${ALSA_LIBRARY} ${G729_LIBRARY}) + ${ALSA_LIBRARY} ${G729_LIBRARY}) install(TARGETS twinkle-console DESTINATION bin) diff --git a/src/call_history.cpp b/src/call_history.cpp index b0fe6f1..8d1a02f 100644 --- a/src/call_history.cpp +++ b/src/call_history.cpp @@ -288,9 +288,9 @@ bool t_call_record::populate_from_file_record(const vector<string> &v) { // Check number of fields if (v.size() != 20) return false; - time_start = strtoul(v[0].c_str(), NULL, 10); - time_answer = strtoul(v[1].c_str(), NULL, 10); - time_end = strtoul(v[2].c_str(), NULL, 10); + time_start = std::stoul(v[0], NULL, 10); + time_answer = std::stoul(v[1], NULL, 10); + time_end = std::stoul(v[2], NULL, 10); if (!set_direction(v[3])) return false; diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 57b8a19..c178b9c 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -134,7 +134,7 @@ add_executable(twinkle ${TWINKLE_GUI-SRCS}) target_link_libraries(twinkle -lpthread -lresolv ${LibMagic_LIBRARY} ${LIBXML2_LIBRARIES} ${Readline_LIBRARY} ${ILBC_LIBRARIES} ${SPEEX_LIBRARIES} ${ZRTPCPP_LIBRARIES} ${CCRTP_LIBRARIES} ${COMMONCPP_LIBRARIES} ${UCOMMON_LIBRARIES} ${LIBSNDFILE_LIBRARY} - ${Boost_LIBRARIES} ${ALSA_LIBRARY} ${qt_LIBS} ${G729_LIBRARY}) + ${ALSA_LIBRARY} ${qt_LIBS} ${G729_LIBRARY}) install(TARGETS twinkle DESTINATION bin) install(FILES ${twinkle_LANG} DESTINATION share/twinkle/lang) diff --git a/src/gui/numberconversionform.cpp b/src/gui/numberconversionform.cpp index af95dd2..f8ae64c 100644 --- a/src/gui/numberconversionform.cpp +++ b/src/gui/numberconversionform.cpp @@ -67,8 +67,8 @@ void NumberConversionForm::validate() } try { - boost::regex re(expr.toStdString()); - } catch (boost::bad_expression) { + std::regex re(expr.toStdString()); + } catch (std::regex_error) { ((t_gui *)ui)->cb_show_msg(this, tr("Invalid regular expression.").toStdString(), MSG_CRITICAL); exprLineEdit->setFocus(); diff --git a/src/gui/userprofileform.cpp b/src/gui/userprofileform.cpp index d7f39a0..788d87b 100644 --- a/src/gui/userprofileform.cpp +++ b/src/gui/userprofileform.cpp @@ -598,7 +598,7 @@ void UserProfileForm::populate() int j = 0; for (list<t_number_conversion>::reverse_iterator i = conversions.rbegin(); i != conversions.rend(); i++, j++) { - QTableWidgetItem* item = new QTableWidgetItem(QString::fromStdString(i->re.str())); + QTableWidgetItem* item = new QTableWidgetItem(QString::fromStdString(i->re)); conversionListView->setItem(j, 0, item); item = new QTableWidgetItem(QString::fromStdString(i->fmt)); conversionListView->setItem(j, 1, item); @@ -712,7 +712,7 @@ list<t_number_conversion> UserProfileForm::get_number_conversions() item = conversionListView->item(0, 1); c.fmt = item->text().toStdString(); conversions.push_back(c); - } catch (boost::bad_expression) { + } catch (std::regex_error) { // Should never happen as validity has been // checked already. Just being defensive here. } 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; } diff --git a/src/user.cpp b/src/user.cpp index a6a2a95..206cf7e 100644 --- a/src/user.cpp +++ b/src/user.cpp @@ -309,7 +309,7 @@ bool t_user::parse_num_conversion(const string &value, t_number_conversion &c) { try { c.re.assign(l[0]); c.fmt = l[1]; - } catch (boost::bad_expression) { + } catch (std::regex_error) { // Invalid regular expression log_file->write_header("t_user::parse_num_conversion", LOG_NORMAL, LOG_WARNING); @@ -2832,7 +2832,7 @@ bool t_user::write_config(const string &filename, string &error_msg) { i != number_conversions.end(); i++) { config << FLD_NUMBER_CONVERSION << '='; - config << escape(i->re.str(), ','); + config << escape(i->re, ','); config << ','; config << escape(i->fmt, ','); config << endl; @@ -3101,10 +3101,10 @@ string t_user::convert_number(const string &number, const list<t_number_conversi for (list<t_number_conversion>::const_iterator i = l.begin(); i != l.end(); i++) { - boost::smatch m; + std::smatch m; try { - if (boost::regex_match(number, m, i->re)) { + if (std::regex_match(number, m, std::regex(i->re))) { string result = m.format(i->fmt); log_file->write_header("t_user::convert_number", @@ -30,7 +30,7 @@ #include "audio/audio_codecs.h" #include "sockets/url.h" #include "threads/mutex.h" -#include "boost/regex.hpp" +#include <regex> // Forward declaration class t_request; @@ -91,10 +91,10 @@ enum t_g726_packing { }; struct t_number_conversion { - boost::regex re; - string fmt; + string re; + string fmt; - string str(void) const { return re.str() + " --> " + fmt; } + string str(void) const { return re + " --> " + fmt; } }; |