Removed empty files.
This commit is contained in:
parent
fb58e4b3b3
commit
ddcd6f9ca3
@ -1,5 +1,5 @@
|
||||
# Modify this file to change the last-modified date when you add/remove a file.
|
||||
# This will then trigger a new cmake run automatically.
|
||||
# This will then trigger a new cmake run automatically.
|
||||
file(GLOB_RECURSE STK_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*.hpp")
|
||||
file(GLOB_RECURSE STK_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*.cpp")
|
||||
file(GLOB_RECURSE STK_SHADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "data/shaders/*")
|
||||
|
@ -1,149 +0,0 @@
|
||||
// tinygettext - A gettext replacement that works directly on .po files
|
||||
// Copyright (C) 2009-2015 Ingo Ruhnke <grumbel@gmx.de>
|
||||
//
|
||||
// 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 (at your option) 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, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
/*
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
#include <sstream>
|
||||
#include <errno.h>
|
||||
#include <stdexcept>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "iconv.hpp"
|
||||
|
||||
namespace tinygettext {
|
||||
|
||||
#ifndef tinygettext_ICONV_CONST
|
||||
# define tinygettext_ICONV_CONST
|
||||
#endif
|
||||
|
||||
IConv::IConv()
|
||||
: to_charset(),
|
||||
from_charset(),
|
||||
cd(0)
|
||||
{}
|
||||
|
||||
IConv::IConv(const std::string& from_charset_, const std::string& to_charset_)
|
||||
: to_charset(),
|
||||
from_charset(),
|
||||
cd(0)
|
||||
{
|
||||
set_charsets(from_charset_, to_charset_);
|
||||
}
|
||||
|
||||
IConv::~IConv()
|
||||
{
|
||||
if (cd)
|
||||
tinygettext_iconv_close(cd);
|
||||
}
|
||||
|
||||
void
|
||||
IConv::set_charsets(const std::string& from_charset_, const std::string& to_charset_)
|
||||
{
|
||||
if (cd)
|
||||
tinygettext_iconv_close(cd);
|
||||
|
||||
from_charset = from_charset_;
|
||||
to_charset = to_charset_;
|
||||
|
||||
for(std::string::iterator i = to_charset.begin(); i != to_charset.end(); ++i)
|
||||
*i = static_cast<char>(toupper(*i));
|
||||
|
||||
for(std::string::iterator i = from_charset.begin(); i != from_charset.end(); ++i)
|
||||
*i = static_cast<char>(toupper(*i));
|
||||
|
||||
if (to_charset == from_charset)
|
||||
{
|
||||
cd = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
cd = tinygettext_iconv_open(to_charset.c_str(), from_charset.c_str());
|
||||
if (cd == reinterpret_cast<tinygettext_iconv_t>(-1))
|
||||
{
|
||||
if(errno == EINVAL)
|
||||
{
|
||||
std::ostringstream str;
|
||||
str << "IConv construction failed: conversion from '" << from_charset
|
||||
<< "' to '" << to_charset << "' not available";
|
||||
throw std::runtime_error(str.str());
|
||||
}
|
||||
else
|
||||
{
|
||||
std::ostringstream str;
|
||||
str << "IConv: construction failed: " << strerror(errno);
|
||||
throw std::runtime_error(str.str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Convert a string from encoding to another.
|
||||
std::string
|
||||
IConv::convert(const std::string& text)
|
||||
{
|
||||
if (!cd)
|
||||
{
|
||||
return text;
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t inbytesleft = text.size();
|
||||
size_t outbytesleft = 4*inbytesleft; // Worst case scenario: ASCII -> UTF-32?
|
||||
|
||||
// We try to avoid to much copying around, so we write directly into
|
||||
// a std::string
|
||||
tinygettext_ICONV_CONST char* inbuf = const_cast<char*>(&text[0]);
|
||||
std::string result(outbytesleft, 'X');
|
||||
char* outbuf = &result[0];
|
||||
|
||||
// Try to convert the text.
|
||||
size_t ret = tinygettext_iconv(cd, (const char**)&inbuf, &inbytesleft, &outbuf, &outbytesleft);
|
||||
if (ret == static_cast<size_t>(-1))
|
||||
{
|
||||
if (errno == EILSEQ || errno == EINVAL)
|
||||
{ // invalid multibyte sequence
|
||||
tinygettext_iconv(cd, NULL, NULL, NULL, NULL); // reset state
|
||||
|
||||
// FIXME: Could try to skip the invalid byte and continue
|
||||
log_error << "error: tinygettext:iconv: invalid multibyte sequence in: \"" << text << "\"" << std::endl;
|
||||
}
|
||||
else if (errno == E2BIG)
|
||||
{ // output buffer to small
|
||||
assert(!"tinygettext/iconv.cpp: E2BIG: This should never be reached");
|
||||
}
|
||||
else if (errno == EBADF)
|
||||
{
|
||||
assert(!"tinygettext/iconv.cpp: EBADF: This should never be reached");
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(!"tinygettext/iconv.cpp: <unknown>: This should never be reached");
|
||||
}
|
||||
}
|
||||
|
||||
result.resize(4*text.size() - outbytesleft);
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace tinygettext
|
||||
*/
|
||||
|
||||
/* EOF */
|
@ -1,72 +0,0 @@
|
||||
// tinygettext - A gettext replacement that works directly on .po files
|
||||
// Copyright (C) 2006-2015 Ingo Ruhnke <grumbel@gmx.de>
|
||||
//
|
||||
// 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 3 of the License, or
|
||||
// (at your option) 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 HEADER_TINYGETTEXT_ICONV_HPP
|
||||
#define HEADER_TINYGETTEXT_ICONV_HPP
|
||||
|
||||
#include <string>
|
||||
|
||||
#ifdef HAVE_SDL
|
||||
# include "SDL.h"
|
||||
|
||||
# define tinygettext_ICONV_CONST const
|
||||
# define tinygettext_iconv_t SDL_iconv_t
|
||||
# define tinygettext_iconv SDL_iconv
|
||||
# define tinygettext_iconv_open SDL_iconv_open
|
||||
# define tinygettext_iconv_close SDL_iconv_close
|
||||
#else
|
||||
# include <iconv.h>
|
||||
|
||||
# ifdef HAVE_ICONV_CONST
|
||||
# define tinygettext_ICONV_CONST ICONV_CONST
|
||||
# else
|
||||
# define tinygettext_ICONV_CONST
|
||||
# endif
|
||||
|
||||
# define tinygettext_iconv_t iconv_t
|
||||
# define tinygettext_iconv iconv
|
||||
# define tinygettext_iconv_open iconv_open
|
||||
# define tinygettext_iconv_close iconv_close
|
||||
#endif
|
||||
|
||||
namespace tinygettext {
|
||||
|
||||
class IConv
|
||||
{
|
||||
private:
|
||||
std::string to_charset;
|
||||
std::string from_charset;
|
||||
tinygettext_iconv_t cd;
|
||||
|
||||
public:
|
||||
IConv();
|
||||
IConv(const std::string& fromcode, const std::string& tocode);
|
||||
~IConv();
|
||||
|
||||
void set_charsets(const std::string& fromcode, const std::string& tocode);
|
||||
std::string convert(const std::string& text);
|
||||
|
||||
private:
|
||||
IConv (const IConv&);
|
||||
IConv& operator= (const IConv&);
|
||||
};
|
||||
|
||||
} // namespace tinygettext
|
||||
|
||||
#endif
|
||||
*/
|
||||
/* EOF */
|
@ -27,7 +27,6 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "language.hpp"
|
||||
#include "iconv.hpp"
|
||||
#include "dictionary.hpp"
|
||||
#include "plural_forms.hpp"
|
||||
|
||||
|
@ -21,8 +21,6 @@
|
||||
#include <iosfwd>
|
||||
#include <string>
|
||||
|
||||
//#include "iconv.hpp"
|
||||
|
||||
namespace tinygettext {
|
||||
|
||||
class Dictionary;
|
||||
|
Loading…
Reference in New Issue
Block a user