mirror of
https://codeberg.org/scip/golsky.git
synced 2025-12-16 20:20:57 +01:00
add profiling support and window geom options to force geometry
This commit is contained in:
19
rle/rle.go
19
rle/rle.go
@@ -20,6 +20,25 @@ type RLE struct {
|
||||
patternLineIndex int
|
||||
}
|
||||
|
||||
// wrapper to load a RLE file
|
||||
func GetRLE(filename string) (*RLE, error) {
|
||||
if filename == "" {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
content, err := os.ReadFile(filename)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
parsedRle, err := Parse(string(content))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to load RLE pattern file: %s", err)
|
||||
}
|
||||
|
||||
return &parsedRle, nil
|
||||
}
|
||||
|
||||
func Parse(input string) (RLE, error) {
|
||||
rle := RLE{
|
||||
inputLines: strings.Split(input, "\n"),
|
||||
|
||||
Reference in New Issue
Block a user