XlsxWorkbookArchiveHelpers
XlsxWorkbookArchiveHelpers
概述
XlsxWorkbookArchiveHelpers 是 Aspose.Cells 为 C++ 提供的 FOSS 中的一个类。
用于从 ZIP 存档读取 XLSX 工作簿部件的内部辅助方法。
此类提供了 21 个用于在 C++ 程序中操作 XlsxWorkbookArchiveHelpers 对象的方法。可用的方法包括:AddIssue、EnsureSeekable、FindRelationshipTarget、FindRelationshipTargetByType、GetEntry、GetRelationshipTargetKind、LoadDateStyleIndexes、LoadDocument、LoadRelationships、LoadSharedStrings、LooksLikeDateFormat、NormalizeFormula,以及另外 9 个方法。安装 Aspose.Cells 为 C++ 提供的 FOSS 包后,所有公共成员对任何 C++ 应用程序均可访问。
方法
| 签名 | 描述 |
|---|---|
XlsxWorkbookArchiveHelpers() | 在此 XlsxWorkbookArchiveHelpers 实例上调用 XlsxWorkbookArchiveHelpers。 |
EnsureSeekable(stream: std::vector<uint8_t>) → std::vector<uint8_t> | 确保字节缓冲区是可寻址的(对内存数据而言保持不变)。 |
GetEntry(archive: ZipArchive, uri: std::string_view) → ZipArchiveEntry | 通过 URI 获取 ZIP 条目,并规范化前导斜杠和反斜杠。 |
LoadDocument(entry: ZipArchiveEntry) → XmlDocument | 从 ZIP 条目加载 XML 文档。 |
LoadRelationships(archive: ZipArchive, relationshipsUri: std::string_view, sourceUri: std::string_view) → std::unordered_map<std::string, std::string> | 从存档中的 .rels 文件加载关系。 |
FindRelationshipTarget(workbookRelationships: std::unordered_map<std::string, std::string>, expectedPath: std::string_view) → std::string | 查找第一个其解析路径与 expectedPath 匹配的关系目标。 |
FindRelationshipTargetByType(workbookRelationships: std::unordered_map<std::string, std::string>, relationshipType: std::string_view) → std::string | 查找第一个其推断类型与 relationshipType 匹配的关系目标。 |
LoadSharedStrings(archive: ZipArchive, workbookRelationships: std::unordered_map<std::string, std::string>, options: LoadOptions, diagnostics: LoadDiagnostics) → std::vector<std::string> | 从存档中加载共享字符串表。 |
LoadDateStyleIndexes(archive: ZipArchive, workbookRelationships: std::unordered_map<std::string, std::string>, options: LoadOptions, diagnostics: LoadDiagnostics) → std::unordered_set<int> | 加载使用日期数字格式的单元格格式索引集合。 |
ParseBoolAttribute(attribute: XmlAttribute) → bool | 解析布尔属性(“1”或“true”返回 true)。 |
ParseIntAttribute(attribute: XmlAttribute) → std::optional<int> | 解析整数属性,若失败或属性为 null 则返回空。 |
ParseDoubleAttribute(attribute: XmlAttribute) → std::optional<double> | 解析双精度属性,若失败或属性为 null 则返回空。 |
NormalizeFormula(value: std::string_view) → std::string | 通过去除首尾空格并剥离开头的 ‘=’ 来标准化公式字符串。 |
ReadInlineString(inlineStringElement: XmlElement) → std::string | 读取 inline-string 元素中的拼接文本。 |
TryParseNumber(rawValue: std::string_view, numberValue: CellValue) → bool | 尝试将原始字符串解析为数字(int 或 double)。 |
AddIssue(diagnostics: LoadDiagnostics, options: LoadOptions, issue: LoadIssue) | 记录加载问题,并在存在时通知警告回调。 |
ResolveWorksheetUri(sheetIndex: int, relationshipId: std::string_view, workbookRelationships: std::unordered_map<std::string, std::string>, archive: ZipArchive, diagnostics: LoadDiagnostics, sheetName: std::string_view, options: LoadOptions) → std::string | 根据关系 ID 解析工作表部件的 URI,如果失败则回退到约定。 |
ResolvePartUri(sourceUri: std::string_view, target: std::string_view) → std::string | 根据源 URI 解析相对或绝对目标。 |
RelationshipPointsTo(candidate: std::string_view, expectedUri: std::string_view) → bool | 测试候选路径是否匹配预期的 URI(不区分大小写)。 |
GetRelationshipTargetKind(candidate: std::string_view) → std::string | 从已解析的目标路径推断关系类型。 |
LooksLikeDateFormat(formatCode: std::string_view) → bool | 测试数字格式代码是否类似日期/时间格式。 |