#ifndef STRING_DATA_HPP
#define STRING_DATA_HPP
#include <clocale>
#include <string>
#include <vector>
#include "GNU/libintl.h"
class StringData
{
private:
std::vector<std::string> data;
public:
StringData(const std::string& type);
std::string operator [](const unsigned int& n) const;
};
#endif
#include "StringData.hpp"
StringData::StringData(const std::string& type)
{
setlocale(LC_ALL, "");
bindtextdomain("StringData", "./po");
textdomain("StringData");
if ( type == "type1" ){
//0,
data.push_back(gettext(" "));
//1
data.push_back(gettext(" "));
//
}
else if ( type == "type2" ){
//0, other
data.push_back(gettext(" "));
//1
data.push_back(gettext(" "));
//
}
else if ( type == "type3" ){
//0
data.push_back(gettext(" "));
//1
data.push_back(gettext(" "));
//
else {
//0
data.push_back(gettext("NULL"));
}
}
std::string StringData::operator [](const unsigned int& n) const
{
if ( n >= data.size() )
return 0;
return data[n];
}
lib: libintl.lib
dll: libiconv2.dll, libintl3.dll
last update: 2008-04-14
posted on 2008-04-14 14:11
lf426 阅读(1159)
评论(2) 编辑 收藏 引用 所属分类:
mySDL_GameEngine