随笔 - 96  文章 - 255  trackbacks - 0
<2008年4月>
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

E-mail:zbln426@163.com QQ:85132383 长期寻找对战略游戏感兴趣的合作伙伴。

常用链接

留言簿(21)

随笔分类

随笔档案

SDL相关网站

我的个人网页

我的小游戏

资源下载

搜索

  •  

积分与排名

  • 积分 - 484879
  • 排名 - 37

最新评论

阅读排行榜

评论排行榜

#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 阅读(1132) 评论(2)  编辑 收藏 引用 所属分类: mySDL_GameEngine

FeedBack:
# re: StringData 2008-04-23 23:20 ask
你好,请教一下,libintl.h这个文件是在libiconv-1.12包里的吗?(我没找到...)
另:是不是除了把iconv.h烤到include目录里还需要烤其他什么东东?怎么会出现"include\iconv.h(26) : error C2018: unknown character '0x40'"这样的错误?
谢谢!  回复  更多评论
  
# re: StringData[未登录] 2008-04-24 11:41 lf426
请参考这篇教程“SDL入门教程(十):1、多语言支持,Win32下的GetText ”,GetText for Windows的主页上,Developer files包含了libintl.h和libintl.lib;libiconv的问题请参考“SDL入门教程(十):3、字符集之间的转换,win32下的libiconv ”,是在SourceForge上下载的,已经为win32编译好了。纯粹从源代码进行编译我还没有试过。:)  回复  更多评论
  

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理