YSTest  PreAlpha_b400_20130424
The YSLib Test Project
 全部 类 命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义 组 页
YSLib::IO::Path类 参考

路径。 更多...

#include <yfilesys.h>

类 YSLib::IO::Path 继承关系图:
YSLib::IO::Path 的协作图:

类

class  iterator
 

Public 类型

typedef GSStringTemplate
< ucs2_t >::basic_string 
StringType
 内部字符串类型。
 
typedef iterator const_iterator
 

Public 成员函数

 Path ()=default
 无参数构造:默认实现。
 
 Path (const Path &)=default
 复制构造:默认实现。
 
 Path (Path &&)=default
 转移构造:默认实现。
 
 Path (const ucs2_t *pathstr)
 
 Path (const NativePathCharType *pathstr)
 
 Path (const NativeString &pathstr)
 
template<class _tString >
 Path (const _tString &pathstr)
 
 ~Path ()=default
 
Path & operator= (const Path &)=default
 复制赋值:默认实现。
 
Path & operator= (Path &&)=default
 转移赋值:默认实现。
 
Path & operator/= (const Path &)
 
bool IsAbsolute () const ynothrow
 
bool IsRelative () const ynothrow
 
bool IsDirectory () const
 判断是否表示目录。
 
bool HasRootName () const
 判断是否有根名称。
 
bool HasRootDirectory () const
 判断是否有根目录。
 
bool HasRootPath () const
 判断是否有根路径。
 
bool HasRelativePath () const
 判断是否有相对路径。
 
bool HasParentPath () const
 判断是否有父路径。
 
bool HasFilename () const
 判断是否有文件名。
 
bool HasStem () const
 判断是否有主文件名。
 
bool HasExtension () const
 判断是否有扩展名。
 
Path GetRootName () const
 取根名称。
 
Path GetRootDirectory () const
 取根目录。
 
Path GetRootPath () const
 取根路径。
 
Path GetRelativePath () const
 取相对路径。
 
Path GetParentPath () const
 取父路径。
 
Path GetFilename () const
 取文件名。
 
Path GetStem () const
 取主文件名。
 
Path GetExtension () const
 取扩展名。
 
NativeString GetNativeString () const ynothrow
 取本地格式和编码的字符串。
 
iterator begin () const
 取起始迭代器。
 
iterator end () const
 取终止迭代器。
 
Path & MakeAbsolute (const Path &)
 构造绝对路径。
 
bool NormalizeTrailingSlash ()
 正规化结尾分隔符:根据路径表示的实体修正结尾 Slash 。
 
Path & RemoveFilename ()
 移除文件名。
 
Path & ReplaceExtension (const Path &={})
 替换扩展名。
 

静态 Public 属性

static yconstexpr ucs2_t Slash = YCL_PATH_DELIMITER
 
static const Path Now
 
static const Path Parent
 

详细描述

路径。

警告
非虚析构。

在文件 yfilesys.h 第 65 行定义.

成员类型定义说明

在文件 yfilesys.h 第 164 行定义.

typedef GSStringTemplate<ucs2_t>::basic_string YSLib::IO::Path::StringType

内部字符串类型。

在文件 yfilesys.h 第 69 行定义.

构造及析构函数说明

YSLib::IO::Path::Path ( )
inlinedefault

无参数构造:默认实现。

YSLib::IO::Path::Path ( const Path &  )
inlinedefault

复制构造:默认实现。

YSLib::IO::Path::Path ( Path &&  )
inlinedefault

转移构造:默认实现。

YSLib::IO::Path::Path ( const ucs2_t *  pathstr)
inline

在文件 yfilesys.h 第 182 行定义.

YSLib::IO::Path::Path ( const NativePathCharType *  pathstr)
inline

在文件 yfilesys.h 第 185 行定义.

YSLib::IO::Path::Path ( const NativeString &  pathstr)
inline

在文件 yfilesys.h 第 188 行定义.

template<class _tString >
YSLib::IO::Path::Path ( const _tString &  pathstr)
inline

在文件 yfilesys.h 第 192 行定义.

YSLib::IO::Path::~Path ( )
inlinedefault

成员函数说明

iterator YSLib::IO::Path::begin ( ) const
inline

取起始迭代器。

在文件 yfilesys.h 第 337 行定义.

参考自 operator/=().

这是这个函数的调用关系图:

iterator YSLib::IO::Path::end ( ) const
inline

取终止迭代器。

在文件 yfilesys.h 第 346 行定义.

参考自 operator/=().

这是这个函数的调用关系图:

Path Path::GetExtension ( ) const

取扩展名。

在文件 yfilesys.cpp 第 139 行定义.

Path Path::GetFilename ( ) const

取文件名。

在文件 yfilesys.cpp 第 129 行定义.

参考 YSLib::end().

函数调用图:

NativeString YSLib::IO::Path::GetNativeString ( ) const
inline

取本地格式和编码的字符串。

在文件 yfilesys.h 第 330 行定义.

参考自 GetDesktopDownHandle(),ShlTextReader::LoadFile(),YSLib::IO::operator<(),YSLib::IO::operator==(),YSLib::IO::ValidatePath() , 以及 ShlTextReader::~ShlTextReader().

这是这个函数的调用关系图:

Path Path::GetParentPath ( ) const

取父路径。

在文件 yfilesys.cpp 第 124 行定义.

参考 YSLib::end().

函数调用图:

Path Path::GetRelativePath ( ) const

取相对路径。

在文件 yfilesys.cpp 第 119 行定义.

参考 YSLib::begin().

函数调用图:

Path Path::GetRootDirectory ( ) const

取根目录。

在文件 yfilesys.cpp 第 109 行定义.

参考 YSLib::IO::FS_Seperator().

函数调用图:

Path Path::GetRootName ( ) const

取根名称。

在文件 yfilesys.cpp 第 103 行定义.

参考 platform::GetRootNameLength().

函数调用图:

Path Path::GetRootPath ( ) const

取根路径。

在文件 yfilesys.cpp 第 114 行定义.

Path Path::GetStem ( ) const

取主文件名。

在文件 yfilesys.cpp 第 134 行定义.

bool YSLib::IO::Path::HasExtension ( ) const
inline

判断是否有扩展名。

在文件 yfilesys.h 第 283 行定义.

bool YSLib::IO::Path::HasFilename ( ) const
inline

判断是否有文件名。

在文件 yfilesys.h 第 267 行定义.

bool YSLib::IO::Path::HasParentPath ( ) const
inline

判断是否有父路径。

在文件 yfilesys.h 第 259 行定义.

bool YSLib::IO::Path::HasRelativePath ( ) const
inline

判断是否有相对路径。

在文件 yfilesys.h 第 251 行定义.

bool YSLib::IO::Path::HasRootDirectory ( ) const
inline

判断是否有根目录。

在文件 yfilesys.h 第 235 行定义.

bool YSLib::IO::Path::HasRootName ( ) const
inline

判断是否有根名称。

在文件 yfilesys.h 第 227 行定义.

bool YSLib::IO::Path::HasRootPath ( ) const
inline

判断是否有根路径。

在文件 yfilesys.h 第 243 行定义.

bool YSLib::IO::Path::HasStem ( ) const
inline

判断是否有主文件名。

在文件 yfilesys.h 第 275 行定义.

bool YSLib::IO::Path::IsAbsolute ( ) const
inline

在文件 yfilesys.h 第 214 行定义.

bool Path::IsDirectory ( ) const

判断是否表示目录。

注解
无视结尾分隔符。
自从
build 298

在文件 yfilesys.cpp 第 96 行定义.

参考 platform::udirexists().

参考自 YSLib::IO::FileList::operator=().

函数调用图:

这是这个函数的调用关系图:

bool YSLib::IO::Path::IsRelative ( ) const
inline

在文件 yfilesys.h 第 215 行定义.

参考自 operator/=().

这是这个函数的调用关系图:

Path & Path::MakeAbsolute ( const Path &  )

构造绝对路径。

在文件 yfilesys.cpp 第 145 行定义.

bool Path::NormalizeTrailingSlash ( )

正规化结尾分隔符:根据路径表示的实体修正结尾 Slash 。

返回
原路径是否改变。
注解
忽略空路径或仅由一个分隔符组成的路径。
自从
build 298

当路径表示目录时保证以 Slash 结尾,否则若存在结尾的 Slash 则删除。

在文件 yfilesys.cpp 第 152 行定义.

参考 platform_ex::IsDirectory() , 以及 YB_UNLIKELY.

函数调用图:

Path & Path::operator/= ( const Path &  path)

在文件 yfilesys.cpp 第 72 行定义.

参考 begin(),YSLib::end(),end(),YSLib::IO::FS_Parent(),platform_ex::IsDirectory() , 以及 IsRelative().

函数调用图:

Path& YSLib::IO::Path::operator= ( const Path &  )
inlinedefault

复制赋值:默认实现。

自从
build 295
Path& YSLib::IO::Path::operator= ( Path &&  )
inlinedefault

转移赋值:默认实现。

自从
build 295
Path & Path::RemoveFilename ( )

移除文件名。

在文件 yfilesys.cpp 第 177 行定义.

Path & Path::ReplaceExtension ( const Path &  new_extension = {})

替换扩展名。

在文件 yfilesys.cpp 第 184 行定义.

类成员变量说明

const Path Path::Now
static

在文件 yfilesys.h 第 73 行定义.

const Path Path::Parent
static

在文件 yfilesys.h 第 74 行定义.

yconstexpr ucs2_t YSLib::IO::Path::Slash = YCL_PATH_DELIMITER
static

在文件 yfilesys.h 第 72 行定义.


该类的文档由以下文件生成: