🛰️航天仿真算法库 SpaceAST 0.3.1
载入中...
搜索中...
未找到
FileStream.hpp 文件参考
#include "AstGlobal.h"
#include "AstUtil/StringView.hpp"
#include "AstUtil/Encode.hpp"
#include <ios>
#include <fstream>
#include <string>

浏览该文件的源代码.

类

class  ast::cxx::ifstream
 
class  ast::cxx::ofstream
 
class  ast::cxx::fstream
 

命名空间

namespace  ast
 
namespace  ast::cxx
 

函数

std::filebuf * ast::cxx::detail::openfilebuf (std::filebuf &buf, const char *filepath, std::ios_base::openmode mode)
 

详细描述

以 UTF-8 编码解释文件路径的 C++ 流

std::ifstream 等在 Windows 上按当前 ANSI 代码页解释窄字符路径 本文件流类提供一层封装,支持以 UTF-8 编码的文件路径

作者
axel
日期
09.10.2026

ast项目(https://github.com/space-ast/ast) 本项目基于 Apache 2.0 开源许可证分发。 您可在遵守许可证条款的前提下使用、修改和分发本软件。 许可证全文请见:

http://www.apache.org/licenses/LICENSE-2.0

重要须知: 软件按“现有状态”提供,无任何明示或暗示的担保条件。 除非法律要求或书面同意,作者与贡献者不承担任何责任。 使用本软件所产生的风险,需由您自行承担。

函数说明

◆ openfilebuf()

std::filebuf * ast::cxx::detail::openfilebuf ( std::filebuf & buf,
const char * filepath,
std::ios_base::openmode mode )
inline

以 UTF-8 编码的路径打开文件缓冲

参数
[out]buf待打开的文件缓冲
[in]filepath文件路径,utf-8 编码
[in]mode打开模式
返回
打开的缓冲指针,失败时为空
注解
Windows 上标准库默认按 ANSI 代码页解释窄字符路径,本函数转换为宽字符以支持 utf-8 编码的路径