文件节点类,继承自 FsNode,表示文件 File node class, inheriting from FsNode, representing a file
More...
#include <ramfs.hpp>
|
int | Run (int argc, char **argv) |
| 运行可执行文件 Runs an executable file
|
|
template<typename DataType , SizeLimitMode LimitMode = SizeLimitMode::MORE> |
const DataType & | GetData () |
| 获取文件数据 Retrieves file data
|
|
文件节点类,继承自 FsNode,表示文件 File node class, inheriting from FsNode, representing a file
Definition at line 93 of file ramfs.hpp.
◆ GetData()
template<typename DataType , SizeLimitMode LimitMode = SizeLimitMode::MORE>
const DataType & LibXR::RamFS::FileNode::GetData |
( |
| ) |
|
|
inline |
获取文件数据 Retrieves file data
- Template Parameters
-
DataType | 数据类型 Data type |
LimitMode | 大小限制模式 Size limit mode (默认:MORE) |
- Returns
- const DataType& 数据引用 Reference to the data
Definition at line 133 of file ramfs.hpp.
134 {
137 {
138 return *
reinterpret_cast<DataType *
>(
addr);
139 }
141 {
142 return *
reinterpret_cast<const DataType *
>(
addr_const);
143 }
144 else
145 {
146 ASSERT(false);
147 const void *
addr =
nullptr;
148 return *
reinterpret_cast<const DataType *
>(
addr);
149 }
150 }
static void SizeLimitCheck(size_t limit, size_t size)
在非调试模式下的占位大小检查函数(无实际作用)。 Dummy size limit check for non-debug builds.
void * addr
读写地址 Read/Write address
FileType type
文件类型 File type
const void * addr_const
只读地址 Read-only address
size_t size
文件大小 File size
@ READ_WRITE
读写 Read/Write
◆ Run()
int LibXR::RamFS::FileNode::Run |
( |
int | argc, |
|
|
char ** | argv ) |
|
inline |
运行可执行文件 Runs an executable file
- Parameters
-
argc | 参数数量 Number of arguments |
argv | 参数列表 Argument list |
- Returns
- int 执行结果 Execution result
Definition at line 119 of file ramfs.hpp.
120 {
123 }
int(* exec)(void *raw, int argc, char **argv)
可执行文件指针 Executable function pointer
void * arg
可执行文件参数 Executable file argument
◆ addr
void* LibXR::RamFS::FileNode::addr |
读写地址 Read/Write address
Definition at line 98 of file ramfs.hpp.
◆ addr_const
const void* LibXR::RamFS::FileNode::addr_const |
只读地址 Read-only address
Definition at line 99 of file ramfs.hpp.
◆ arg
void* LibXR::RamFS::FileNode::arg |
可执行文件参数 Executable file argument
Definition at line 107 of file ramfs.hpp.
◆ exec
int(* LibXR::RamFS::FileNode::exec) (void *raw, int argc, char **argv) |
可执行文件指针 Executable function pointer
Definition at line 100 of file ramfs.hpp.
◆ size
size_t LibXR::RamFS::FileNode::size |
◆ type
The documentation for this class was generated from the following file: