Documentation
¶
Index ¶
- Constants
- Variables
- func CommentByBreak(b []byte) []string
- func CommentByLine(b []byte) []string
- func Index(b []byte) int
- func UnsignedBinary1(b [1]byte) uint8
- func UnsignedBinary2(b [2]byte) uint16
- func UnsignedBinary4(b [4]byte) uint16
- type ANSIFlagAR
- type ANSIFlagB
- type ANSIFlagLS
- type ANSIFlags
- type ArBit
- type Archive
- type Audio
- type Author
- type BBit
- type BinaryText
- type Bitmap
- type Character
- type Comment
- type Comments
- type Comnt
- type Data
- type DataType
- type Datas
- type Date
- type Dates
- type Executable
- type FileSize
- type FileType
- type Files
- type Flags
- type Group
- type ID
- type Info
- type Infos
- type Layout
- type LsBit
- type None
- type Sizes
- type TFlags
- type TInfo1
- type TInfo2
- type TInfo3
- type TInfo4
- type TInfoS
- type Title
- type TypeOfData
- type TypeOfFile
- type Vector
- type Version
- type XBin
Constants ¶
const ( ComntID string = "COMNT" // comntid is the comment block identification that must be "COMNT" SauceID string = "SAUCE" // sauceid is the SAUCE identification that must be "SAUCE" SauceVersion string = "00" // sauce version number that is always "00" SauceSeek string = SauceID + SauceVersion // sauceseek is the sauce id and version value to lookup ComntLineSize int = 64 // comntlinesize is the fix length in bytes of an individual comment line ComntMaxLines int = 255 // comntmaxlines is the maximum permitted number of lines for a block of comments )
const Unsupported = "no preference"
Unsupported is a legacy value used by Letter-spacing and Aspect Ratio. It acts as an unsupported placeholder for SAUCE versions prior to v00.5 from Nov 2013.
Variables ¶
var ( ErrParseDate = errors.New("parse date to integer conversion") ErrSauceDate = errors.New("sauce date error") )
var ErrFileType = errors.New("unknown filetype")
var ErrInvalid = errors.New("invalid value")
Functions ¶
func CommentByBreak ¶
CommentByBreak parses the SAUCE comment by line break characters.
func CommentByLine ¶
CommentByLine parses the SAUCE comment by lines of 64 characters.
func UnsignedBinary1 ¶
UnsignedBinary1 returns the unsigned 1 byte integer from b using little-endian byte order.
func UnsignedBinary2 ¶
func UnsignedBinary4 ¶
Types ¶
type ANSIFlagAR ¶
type ANSIFlagAR struct {
Flag ArBit `json:"flag" xml:"flag"` // ar aspect ratio value
Info string `json:"interpretation" xml:"interpretation,attr"` // info description of the value
}
ANSIFlagAR is the interpretation of the SAUCE Flags aspect ratio binary bits.
type ANSIFlagB ¶
type ANSIFlagB struct {
Flag BBit `json:"flag" xml:"flag"` // flag the non-blink "iCE Color" toggle
Info string `json:"interpretation" xml:"interpretation,attr"` // info description of the toggle
}
ANSIFlagB is the interpretation of the SAUCE Flags non-blink mode binary bit.
type ANSIFlagLS ¶
type ANSIFlagLS struct {
Flag LsBit `json:"flag" xml:"flag"` // lsbit letter-spacing value
Info string `json:"interpretation" xml:"interpretation,attr"` // info description of the value
}
ANSIFlagLS is the interpretation of the SAUCE Flags letter spacing binary bits.
type ANSIFlags ¶
type ANSIFlags struct {
Decimal Flags `json:"decimal" xml:"decimal,attr"` // decimal, unsigned integer flags value
Binary string `json:"binary" xml:"binary,attr"` // binary notation flags value
B ANSIFlagB `json:"nonBlinkMode" xml:"non_blink_mode"` // b is the non-blink "iCE Color" toggle
LS ANSIFlagLS `json:"letterSpacing" xml:"letter_spacing"` // ls is the letter-spacing value
AR ANSIFlagAR `json:"aspectRatio" xml:"aspect_ratio"` // ar is the aspect ratio value
Interpretations string `json:"-" xml:"-"` // interpretations are humanized descriptions of the bits
}
ANSIFlags allow an author of ANSi and similar files to provide a clue to a viewer/editor how to render the image.
type BinaryText ¶
type BinaryText uint
BinaryText is a raw memory copy of a text mode screen.
const (
BinaryScreenImage BinaryText = iota
)
func (BinaryText) String ¶
func (b BinaryText) String() string
type Comment ¶
type Comment struct {
ID string `json:"id" xml:"id,attr"` // id is the SAUCE comment block identification, this should be "COMNT"
Count int `json:"count" xml:"count,attr"` // count are the reported number of lines in the SAUCE comment block
Index int `json:"-" xml:"-"` // index are the calculated starting position of the comment block
Comment []string `json:"lines" xml:"line"` // comment value, each comment line should be comprised of 64 characters
}
Comment contains the optional SAUCE comment block. A SAUCE comment block is an optional, variable sized structure that holds up to 255 lines of additional information, each line 64 characters wide.
type Comments ¶
type Comments [1]byte // comments are the number of lines in the extra SAUCE comment block
type Datas ¶
type Datas struct {
Type TypeOfData `json:"type" xml:"type"` // typeofdata is the unsigned data type
Name string `json:"name" xml:"name"` // name of the data type
}
Datas is the SAUCE DataType value and name.
type Dates ¶
type Dates struct {
Value string `json:"value" xml:"value"` // date format using CCYYMMDD (century, year, month, day)
Time time.Time `json:"iso" xml:"date"` // time as a go time type
Epoch int64 `json:"epoch" xml:"epoch,attr"` // epoch unix time, is the number of seconds since 1 Jan 1970
}
Dates is the date the file was created, in multiple time formats.
type Executable ¶
type Executable uint
Executable program files.
const (
Exe Executable = iota
)
func (Executable) String ¶
func (e Executable) String() string
type FileType ¶
type FileType [1]byte // file type is the technical format of the file, such as a GIF
type Files ¶
type Files struct {
Type TypeOfFile `json:"type" xml:"type"` // type of file unsigned integer
Name string `json:"name" xml:"name"` // name of the file type
}
Files is the SAUCE FileType value and name.
type Info ¶
type Info struct {
// Value of the field.
Value uint16 `json:"value" xml:"value"`
// Info is a description of the value.
Info string `json:"info" xml:"type,attr"`
}
Info is the type for the SAUCE TInfo1, TInfo2, TInfo3 and TInfo4 fields.
type Infos ¶
type Infos struct {
// Info1 dependant numeric information field 1.
Info1 Info `json:"1" xml:"type1"`
// Info2 dependant numeric information field 2.
Info2 Info `json:"2" xml:"type2"`
// Info3 dependant numeric information field 3.
Info3 Info `json:"3" xml:"type3"`
// Flags are file type dependant flags.
Flags ANSIFlags `json:"flags" xml:"flags"`
// Font field allows an author to provide a clue to the viewer/editor which font to use to render the image.
Font string `json:"fontName" xml:"fontname"`
}
Infos includes the SAUCE fields dependant on both DataType and FileType.
type Layout ¶
type Layout struct {
ID ID
Version Version
Title Title
Author Author
Group Group
Date Date
Filesize FileSize
Datatype DataType
Filetype FileType
Tinfo1 TInfo1
Tinfo2 TInfo2
Tinfo3 TInfo3
Tinfo4 TInfo4
Comments Comments
TFlags TFlags
TInfoS TInfoS
Comnt Comnt
}
func (*Layout) CommentBlock ¶
CommentBlock parses the optional SAUCE comment block.
func (*Layout) Description ¶
type Sizes ¶
type Sizes struct {
Bytes uint16 `json:"bytes" xml:"bytes"` // bytes as an integer
Decimal string `json:"decimal" xml:"decimal,attr"` // decimal is a base 10 value
Binary string `json:"binary" xml:"binary,attr"` // binary is a base 2 value
}
Sizes is the original file size in multiple formats.
type TypeOfData ¶
type TypeOfData uint
TypeOfData is the SAUCE DataType.
const ( Nones TypeOfData = iota // undefined filetype Characters // characters and plain text based files Bitmaps // bitmap, graphic and animation files Vectors // vector graphic files Audios // audio and sound files BinaryTexts // binary texts that are raw memory copies of a text mode screen, also known as a 'bin' file XBins // xbin or extended bin file Archives // archived file such as a zip package Executables // executable file that is an application or program launcher )
func (TypeOfData) String ¶
func (d TypeOfData) String() string