Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Header = "reMarkable .lines file, version=6 "
Header is an rm file header
Functions ¶
This section is empty.
Types ¶
type HeaderLayers ¶
HeaderLayers is the header and number of layers format <{}sI
func HeaderParse ¶
func HeaderParse(f fs.File) (HeaderLayers, error)
HeaderParse starts parsing an .rm file, returning the header and number of layers
type MaxCoordinates ¶
MaxCoordinates stores the maximum and minimum path segments
type Path ¶
type Path struct {
Pen uint32
Colour uint32
Width float32
NumSegments uint32
// contains filtered or unexported fields
}
Path describes a path format <IIIfII
type Paths ¶
type Paths struct {
Number uint32
}
Paths is the number of paths in this layer format <I
type RMFile ¶
type RMFile struct {
File fs.File
Header [43]byte
LayerNo uint32
ThisLayer uint32
PathNo uint32
ThisPath uint32
Path RMPath
MaxCoordinates MaxCoordinates
Verbose bool
}
RMFile is the reMarkable .rm file File parser metadata base structure
func RMParse ¶
RMParse instantiates a parser by registering a file to parse and initialising the header, layer count and related counters. Continue parsing using the "Parse()" iterator-type function.
func (*RMFile) Parse ¶
Parse an .rm file, returning an RMPath data structure until depleted. The Parse() function collects all the segments in a path and collects it in an RMFile.Path struct, stored in RMFile.Path. The Parse function is based loosely on bufio.Scan() so it may be called using "for" as follows:
rm := rmparse.RMParse(filename)
for rm.Parse() {
path = rm.Path
}
Catching io.ErrUnexpectedEOF errors is necessary because it is possible to have corrupt .rm files which, for example, report layers but do not have any content.