cpp-mirai-client  v2.6.1
cpp client for mirai-api-http
Mirai::FilePath类 参考

文件路径 更多...

#include <MediaTypes.hpp>

Mirai::FilePath 的协作图:
[图例]

Public 成员函数

 FilePath ()=default
 构造函数 更多...
 
 FilePath (std::string dir, bool isPath=false)
 构造函数 更多...
 
 FilePath (const GroupFileInfo &file)
 构造函数 更多...
 
bool isPath () const
 判定是否为文件名路径 更多...
 
std::string GetPath () const
 获取文件名路径 更多...
 
std::string GetId () const
 获取文件id 更多...
 
FilePathSetPath (const std::string &path)
 设置文件名路径 更多...
 
FilePathSetId (const std::string &id)
 设置文件id 更多...
 

Protected 属性

std::string dir_
 
bool isPath_ = false
 

详细描述

文件路径

类似于Union的结构,可由文件id或者文件位置 /path/to/file 指定。 由于文件名可以不唯一,推荐尽量使用id。

Member Variable Default Value
FilePath::dir_ ""
FilePath::isPath_ false

在文件 MediaTypes.hpp107 行定义.

构造及析构函数说明

◆ FilePath() [1/3]

Mirai::FilePath::FilePath ( )
default

构造函数

◆ FilePath() [2/3]

Mirai::FilePath::FilePath ( std::string  dir,
bool  isPath = false 
)
inline

构造函数

参数
dir文件路径,可能为id或文件名路径
isPath是否为文件名路径

在文件 MediaTypes.hpp126 行定义.

◆ FilePath() [3/3]

Mirai::FilePath::FilePath ( const GroupFileInfo file)
inline

构造函数

参数
fileGroupFileInfo 对象

在文件 MediaTypes.hpp132 行定义.

成员函数说明

◆ isPath()

bool Mirai::FilePath::isPath ( ) const
inline

判定是否为文件名路径

返回
bool

在文件 MediaTypes.hpp139 行定义.

◆ GetPath()

std::string Mirai::FilePath::GetPath ( ) const
inline

获取文件名路径

仅当 isPath()true 时有效,否则返回空字符串

返回
文件名路径

在文件 MediaTypes.hpp147 行定义.

◆ GetId()

std::string Mirai::FilePath::GetId ( ) const
inline

获取文件id

仅当 isPath()false 时有效,否则返回空字符串

返回
文件id

在文件 MediaTypes.hpp155 行定义.

◆ SetPath()

FilePath & Mirai::FilePath::SetPath ( const std::string &  path)
inline

设置文件名路径

参数
path文件名路径
返回
Reference to *this

在文件 MediaTypes.hpp163 行定义.

◆ SetId()

FilePath & Mirai::FilePath::SetId ( const std::string &  id)
inline

设置文件id

参数
id文件名id
返回
Reference to *this

在文件 MediaTypes.hpp176 行定义.

类成员变量说明

◆ dir_

std::string Mirai::FilePath::dir_
protected

在文件 MediaTypes.hpp110 行定义.

◆ isPath_

bool Mirai::FilePath::isPath_ = false
protected

在文件 MediaTypes.hpp111 行定义.


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