From 8fec7bffddc6e5490e0fd402791e95ed1287c914 Mon Sep 17 00:00:00 2001 From: Jonathan Campbell Date: Wed, 20 Mar 2019 13:03:40 -0700 Subject: [PATCH] move --- experiments/iconv/iconvpp.cpp | 15 +++++++++++++++ experiments/iconv/iconvpp.hpp | 15 +-------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/experiments/iconv/iconvpp.cpp b/experiments/iconv/iconvpp.cpp index ee44a9e73..c027c3737 100644 --- a/experiments/iconv/iconvpp.cpp +++ b/experiments/iconv/iconvpp.cpp @@ -1,3 +1,18 @@ #include "iconvpp.hpp" +const char *_Iconv_CommonBase::errstring(int x) { + if (x >= 0) + return "no error"; + else if (x == err_noinit) + return "not initialized"; + else if (x == err_noroom) + return "out of room"; + else if (x == err_notvalid) + return "illegal multibyte sequence or invalid state"; + else if (x == err_incomplete) + return "incomplete multibyte sequence"; + + return "?"; +} + diff --git a/experiments/iconv/iconvpp.hpp b/experiments/iconv/iconvpp.hpp index 93853eaf9..58367268b 100644 --- a/experiments/iconv/iconvpp.hpp +++ b/experiments/iconv/iconvpp.hpp @@ -41,20 +41,7 @@ class _Iconv_CommonBase { public: - static const char *errstring(int x) { - if (x >= 0) - return "no error"; - else if (x == err_noinit) - return "not initialized"; - else if (x == err_noroom) - return "out of room"; - else if (x == err_notvalid) - return "illegal multibyte sequence or invalid state"; - else if (x == err_incomplete) - return "incomplete multibyte sequence"; - - return "?"; - } + static const char *errstring(int x); inline size_t get_src_last_read(void) const { /* in units of sizeof(srcT) */ return src_adv; }