metadata

package
v0.0.0-...-afc20ba Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2020 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package metadata implements the small metadata database written to each directory on the MegaSD filesystem that contains ROM and/or CD images.

Index

Constants

View Source
const (
	// Filename is the expected filename used when writing to disk
	Filename = "games.dbs"

	// ScreenshotSize defines the expected size in bytes of each screenshot
	ScreenshotSize = 2048
)

Variables

This section is empty.

Functions

func CRCFilename

func CRCFilename(filename string) uint32

CRCFilename computes the CRC of a given filename using the same algorithm as implemented in the MegaSD firmware

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

DB is the metadata database object. It implements the encoding.BinaryMarshaler and encoding.BinaryUnmarshaler interfaces.

func New

func New() *DB

New returns an empty metadata database

func (*DB) Length

func (db *DB) Length() int

Length returns the number of checksums in the database

func (*DB) MarshalBinary

func (db *DB) MarshalBinary() ([]byte, error)

MarshalBinary encodes the database into binary form and returns the result

func (*DB) Set

func (db *DB) Set(crc uint32, screenshot []byte) error

Set stores the provided screenshot for the given CRC

func (*DB) UnmarshalBinary

func (db *DB) UnmarshalBinary(b []byte) error

UnmarshalBinary decodes the database from binary form

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL