|
🛰️航天仿真算法库 SpaceAST 0.0.1
|
#include <DAFParser.hpp>
类 ast::DAFParser 继承关系图:Public 类型 | |
| using | Record = std::array<char, 1024> |
Public 成员函数 | |
| DAFParser (StringView filepath) | |
| errc_t | parse () |
| errc_t | parse (StringView filepath) |
| bool | isValidFile () const |
| size_t | readRecord (int recordIndex, void *buffer, size_t size) const |
| size_t | readFileRecord (void *buffer, size_t size) const |
| errc_t | getFileRecord (Record &fileRecord) const |
| errc_t | getSummaryRecords (std::vector< Record > &summaryRecords) const |
| errc_t | getFileRecord (int &nd, int &ni, int &fward, int &bward, int &free) const |
| errc_t | getComment (std::string &comment) const |
| errc_t | getComment (std::vector< std::string > &comments) const |
| void | printComment (std::FILE *fp=stdout) const |
| void | open (StringView filepath) |
Public 成员函数 继承自 ast::BaseParser | |
| BaseParser (StringView filepath) | |
| void | open (StringView filepath) |
| bool | isOpen () const |
| void | close () |
| void | seek (std::streamoff pos, std::ios::seekdir dir) |
| std::streamoff | tell () |
| bool | eof () const |
| size_t | read (void *buffer, size_t size, size_t pos) const |
| StringView | getLineWithNewline () |
| StringView | getLine () |
| StringView | getLineTrim () |
| StringView | getLineSkipHashComment () |
| int | getLineNumber () |
| std::string | getFilePath () const |
| void | setBorrowedFile (FILE *file) |
| void | setOwnedFile (FILE *file) |
| FILE * | getFile () const |
Protected 成员函数 | |
| errc_t | runTest () |
| errc_t | readSummaryRecords (int fward, int bward, std::vector< Record > &summaryRecords) const |
| const DAF_FileRecord * | getFileRecord () const |
Protected 属性 | |
| Record | fileRecord_ |
| bool | isValidFile_ =false |
| bool | isSameEndian_ =false |
Protected 属性 继承自 ast::BaseParser | |
| FILE * | file_ {nullptr} |
| bool | fileBorrowed_ {false} |
| std::vector< char > | lineBuffer_ |
SPICE 双精度数组文件解析器 DAF(Double Precision Array File,双精度数组文件)
该类用于解析SPICE的双精度数组文件(DAF),提取其中的数组数据。
| errc_t ast::DAFParser::getComment | ( | std::string & | comment | ) | const |
获取文件注释
| comment | 接收文件注释的字符串引用 |
| errc_t ast::DAFParser::getComment | ( | std::vector< std::string > & | comments | ) | const |
获取文件注释
| comment | 接收文件注释的字符串向量引用 |
| errc_t ast::DAFParser::getFileRecord | ( | int & | nd, |
| int & | ni, | ||
| int & | fward, | ||
| int & | bward, | ||
| int & | free ) const |
获取文件记录头信息
| nd | 双精度分量个数 ND |
| ni | 整型分量个数 NI |
| fward | 第一个摘要记录号 |
| bward | 最后一个摘要记录号 |
| free | 第一个空闲字地址 |
| errc_t ast::DAFParser::getFileRecord | ( | Record & | fileRecord | ) | const |
获取文件记录头
| fileRecord | 接收文件记录头的引用 |
| errc_t ast::DAFParser::getSummaryRecords | ( | std::vector< Record > & | summaryRecords | ) | const |
获取所有摘要记录
| summaryRecords | 接收摘要记录的向量 |
| bool ast::DAFParser::isValidFile | ( | ) | const |
检查解析结果是否有效
| void ast::BaseParser::open | ( | StringView | filepath | ) |
打开文件
打开指定路径的文件,用于后续的解析操作。
| filepath | 文件路径视图,指定要打开的文件路径。 |
| errc_t ast::DAFParser::parse | ( | ) |
解析DAF文件
读取文件记录头、摘要记录和名称记录。
摘要大小 (size of a single summary)
每个摘要记录可存储的摘要个数 (number of summaries)
每个名称长度 (number of characters in a single name)
| errc_t ast::DAFParser::parse | ( | StringView | filepath | ) |
解析指定路径的DAF文件
打开文件、解析文件记录头、摘要记录和名称记录。
| filepath | 文件路径 |
| void ast::DAFParser::printComment | ( | std::FILE * | fp = stdout | ) | const |
打印文件注释到指定文件流
| fp | 文件流指针,默认输出到标准输出 |
| size_t ast::DAFParser::readFileRecord | ( | void * | buffer, |
| size_t | size ) const |
读取文件记录头到缓冲区
| buffer | 指向接收数据的缓冲区指针 |
| size | 缓冲区大小,单位为字节 |
| size_t ast::DAFParser::readRecord | ( | int | recordIndex, |
| void * | buffer, | ||
| size_t | size ) const |
读取指定记录索引的数据到缓冲区
| recordIndex | 记录索引,从0开始 |
| buffer | 指向接收数据的缓冲区指针 |
| size | 缓冲区大小,单位为字节 |
|
protected |
摘要大小 (size of a single summary)
每个摘要记录可存储的摘要个数 (number of summaries)
每个名称长度 (number of characters in a single name)