summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-01-20 20:16:55 +0300
committerAndrei Karas <akaras@inbox.ru>2017-01-20 20:16:55 +0300
commit9e2074d093ecdf9afc95a2fefc24b38307da627d (patch)
tree1929792a3b9a9417dc152d6925b46b9e13cbec1c /src
parent83d9ca38a91bd9d23cf439c3426f18b08906fc57 (diff)
downloadplus-9e2074d093ecdf9afc95a2fefc24b38307da627d.tar.gz
plus-9e2074d093ecdf9afc95a2fefc24b38307da627d.tar.bz2
plus-9e2074d093ecdf9afc95a2fefc24b38307da627d.tar.xz
plus-9e2074d093ecdf9afc95a2fefc24b38307da627d.zip
Move utf8 constant into separate file.
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/Makefile.am1
-rw-r--r--src/const/utils/utf8.h28
-rw-r--r--src/utils/stringutils.cpp2
-rw-r--r--src/utils/stringutils.h2
-rw-r--r--src/utils/stringutils_unittest.cc2
6 files changed, 34 insertions, 2 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4432d86e9..c7e8c78c7 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1028,6 +1028,7 @@ SET(SRCS
const/equipment.h
const/spells.h
const/utils/timer.h
+ const/utils/utf8.h
const/gui/chat.h
const/gui/pages.h
const/gui/theme.h
diff --git a/src/Makefile.am b/src/Makefile.am
index d3c664606..76db75c8e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -582,6 +582,7 @@ SRC += events/actionevent.h \
const/equipment.h \
const/spells.h \
const/utils/timer.h \
+ const/utils/utf8.h \
const/gui/chat.h \
const/gui/theme.h \
const/render/graphics.h \
diff --git a/src/const/utils/utf8.h b/src/const/utils/utf8.h
new file mode 100644
index 000000000..d7042f958
--- /dev/null
+++ b/src/const/utils/utf8.h
@@ -0,0 +1,28 @@
+/*
+ * The ManaPlus Client
+ * Copyright (C) 2011-2017 The ManaPlus Developers
+ *
+ * This file is part of The ManaPlus Client.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef CONST_UTILS_UTF8_H
+#define CONST_UTILS_UTF8_H
+
+#include "localconsts.h"
+
+static const size_t UTF8_MAX_SIZE = 10;
+
+#endif // CONST_UTILS_UTF8_H
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp
index 7671961bc..bb7f7efb5 100644
--- a/src/utils/stringutils.cpp
+++ b/src/utils/stringutils.cpp
@@ -22,6 +22,8 @@
#include "utils/stringutils.h"
+#include "const/utils/utf8.h"
+
#ifndef DYECMD
#include "resources/iteminfo.h"
diff --git a/src/utils/stringutils.h b/src/utils/stringutils.h
index 8053be689..f9d7494aa 100644
--- a/src/utils/stringutils.h
+++ b/src/utils/stringutils.h
@@ -30,8 +30,6 @@
#include "localconsts.h"
-static const size_t UTF8_MAX_SIZE = 10;
-
/**
* Trims spaces off the end and the beginning of the given string.
*
diff --git a/src/utils/stringutils_unittest.cc b/src/utils/stringutils_unittest.cc
index c90dd1afd..998c5831b 100644
--- a/src/utils/stringutils_unittest.cc
+++ b/src/utils/stringutils_unittest.cc
@@ -22,6 +22,8 @@
#include "configuration.h"
#include "logger.h"
+#include "const/utils/utf8.h"
+
#include "utils/physfstools.h"
#include "resources/iteminfo.h"