FileAnalyzer
A class that provides functions to analyze PD3 files and retrieve device-dependent data.
Class methods
analyzePD3
Analyzes a PD3 file and returns the analysis result, including device-dependent data and any errors encountered during the process.
Declaration
fun analyzePD3(filePath: String) : Result<PtouchDeviceDependedDataHeader>
Parameters
Name | Type | Description |
---|---|---|
filePath | String | The path of the PD3 file to be analyzed. |
Return Value
Parameter | Description |
---|---|
Result<PtouchDeviceDependedDataHeader> |
The result of the file analysis, including the PtouchDeviceDependedDataHeader and any errors. |
Types
Result
A data class containing the result of the file analysis and the corresponding data report.
Properties
report
A generic type representing the analysis report. The type of this property depends on the analysis performed. If there are errors, this is null.
val report: T?
error
An error class. For detail, see Error
.
val error: Error
Error
A data class containing error details encountered during the file analysis.
Properties
code
An error code. For detail, see Code
.
val code: Code
allLogs
A list of log entries that were generated during the file analysis. For detail, see Log
.
val allLogs: List<Log>
description
A string describing the error that occurred during the file analysis.
val description: String
Types
Code(Types)
An enum representing the possible error codes.
enum class Code(val id: Int) {
NoError(0 + ErrorCodeBaseID),
FileNotFound(1 + ErrorCodeBaseID),
FileFormatIncorrectly(2 + ErrorCodeBaseID),
UnknownError(99 + ErrorCodeBaseID),
}
const val ErrorCodeBaseID: Int = 40000