加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
fsencoding.hh 1.21 KB
一键复制 编辑 原始数据 按行查看 历史
Abs62 提交于 2012-02-21 01:47 . Update year in copyright notices.
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifndef __FSENCODING_HH_INCLUDED__
#define __FSENCODING_HH_INCLUDED__
#include "wstring.hh"
#include <QString>
/// Utilities to convert a wide string or an utf8 string to the local 8bit
/// encoding of the file system, and to do other manipulations on the file
/// names.
namespace FsEncoding {
using std::string;
using gd::wstring;
/// Encodes the given wide string to the utf8 encoding.
string encode( wstring const & );
/// Encodes the given string in utf8 to the system 8bit encoding.
string encode( string const & );
/// Encodes the QString to the utf8/local 8-bit encoding.
string encode( QString const & );
/// Decodes the given utf8-encoded string to a wide string.
wstring decode( string const & str );
/// Decodes the given utf8/local 8-bit string to a QString.
QString decode( const char *str );
/// Returns the filesystem separator (/ on Unix and clones, \ on Windows).
char separator();
/// Returns the directory part of the given filename.
string dirname( string const & );
/// Returns the name part of the given filename.
string basename( string const & );
}
#endif
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化