summaryrefslogtreecommitdiff
path: root/src/bridge
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2014-04-29 21:50:13 +0200
committerFlorent Le Coz <louiz@louiz.org>2014-04-29 21:50:13 +0200
commitf6e6b8905be010d7329316cea4546900ad8a2d19 (patch)
treec27ff5b83d11c5631742ffc945e3f887fbca0f54 /src/bridge
parent594bac1e841588aef66efc208a295e08273aec32 (diff)
downloadbiboumi-f6e6b8905be010d7329316cea4546900ad8a2d19.tar.gz
biboumi-f6e6b8905be010d7329316cea4546900ad8a2d19.tar.bz2
biboumi-f6e6b8905be010d7329316cea4546900ad8a2d19.tar.xz
biboumi-f6e6b8905be010d7329316cea4546900ad8a2d19.zip
Use C++14 string_literals
Diffstat (limited to 'src/bridge')
-rw-r--r--src/bridge/bridge.cpp8
-rw-r--r--src/bridge/colors.cpp6
2 files changed, 9 insertions, 5 deletions
diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp
index 12a56d7..4b2d895 100644
--- a/src/bridge/bridge.cpp
+++ b/src/bridge/bridge.cpp
@@ -10,6 +10,8 @@
#include <iostream>
#include <tuple>
+using namespace std::string_literals;
+
static const char* action_prefix = "\01ACTION ";
Bridge::Bridge(const std::string& user_jid, XmppComponent* xmpp, Poller* poller):
@@ -243,9 +245,9 @@ void Bridge::send_xmpp_message(const std::string& from, const std::string& autho
if (!author.empty())
{
IrcUser user(author);
- body = std::string("\u000303") + user.nick + (user.host.empty()?
- std::string("\u0003: "):
- (" (\u000310" + user.host + std::string("\u000303)\u0003: "))) + msg;
+ body = "\u000303"s + user.nick + (user.host.empty()?
+ "\u0003: ":
+ (" (\u000310" + user.host + "\u000303)\u0003: ")) + msg;
}
else
body = msg;
diff --git a/src/bridge/colors.cpp b/src/bridge/colors.cpp
index 49f7a39..6f6d7a9 100644
--- a/src/bridge/colors.cpp
+++ b/src/bridge/colors.cpp
@@ -6,6 +6,8 @@
#include <string.h>
+using namespace std::string_literals;
+
static const char IRC_NUM_COLORS = 16;
static const char* irc_colors_to_css[IRC_NUM_COLORS] = {
@@ -130,10 +132,10 @@ Xmpp::body irc_format_to_xhtmlim(const std::string& s)
if (styles.italic)
styles_str += "font-style:italic;";
if (styles.fg != -1)
- styles_str += std::string("color:") +
+ styles_str += "color:"s +
irc_colors_to_css[styles.fg % IRC_NUM_COLORS] + ";";
if (styles.bg != -1)
- styles_str += std::string("background-color:") +
+ styles_str += "background-color:"s +
irc_colors_to_css[styles.bg % IRC_NUM_COLORS] + ";";
if (!styles_str.empty())
{