Documentation ¶
Overview ¶
ANSiFlags allow an author of ANSi and similar files to provide a clue to a viewer / editor how to render the image. The 8 bits in the ANSiFlags contain the following information: 0 0 0 A R L S B B: Non-blink mode (iCE Color). LS: Letter-spacing (a.k.a. 8/9 pixel font selection). AR: Aspect Ratio. See http://www.acid.org/info/sauce/sauce.htm#ANSiFlags.
An archive file data type. See http://www.acid.org/info/sauce/sauce.htm#FileType
An audio file data type. See http://www.acid.org/info/sauce/sauce.htm#FileType
This is a raw memory copy of a text mode screen. Also known as a .BIN file. This is essentially a collection of character and attribute pairs. See http://www.acid.org/info/sauce/sauce.htm#FileType
Bitmap graphic and animation files. See http://www.acid.org/info/sauce/sauce.htm#FileType
A character based file. These files are typically interpreted sequentially. Also known as streams. See http://www.acid.org/info/sauce/sauce.htm#FileType
A SAUCE comment block is an optional, variable sized structure that holds up to 255 lines of additional information, each line 64 characters wide. There are as many comment lines as is mentioned in the Comments field of the SAUCE record. If the Comments field is set to 0, there should not be a comment block at all. See http://www.acid.org/info/sauce/sauce.htm
Type of data. SAUCE supports 8 different types and an undefined value. See http://www.acid.org/info/sauce/sauce.htm
The date the file was created. The format for the date is CCYYMMDD (century, year, month, day). Example: 4 May 2013 would be stored as "20130504". See http://www.acid.org/info/sauce/sauce.htm
A executable file. Any executable file. .exe, .dll, .bat, ... Executable scripts such as .vbs should be tagged as Source. See http://www.acid.org/info/sauce/sauce.htm#FileType
Type of file. See http://www.acid.org/info/sauce/sauce.htm#FileType
Undefined filetype. You could use this to add SAUCE to a custom or proprietary file, without giving it any particular meaning or interpretation. See http://www.acid.org/info/sauce/sauce.htm#FileType
A vector graphic file. See http://www.acid.org/info/sauce/sauce.htm#FileType
An XBin or eXtended BIN file. See http://www.acid.org/info/sauce/sauce.htm#FileType
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" // SAUCE comment block identification. This should be equal to "COMNT". SauceID string = "SAUCE" // SAUCE identification, this should be equal to "SAUCE". SauceVersion string = "00" // SAUCE version number, should be "00". SauceSeek string = SauceID + SauceVersion // SAUCE sequence to seek. ComntLineSize int = 64 // A SAUCE comment line is 64 characters wide. ComntMaxLines int = 255 // A SAUCE comment is variable sized structure that holds up to 255 lines of additional information. )
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 ¶
func UnsignedBinary2 ¶
func UnsignedBinary4 ¶
Types ¶
type ANSIFlagAR ¶
type ANSIFlagAR struct { Flag ArBit `json:"flag" xml:"flag"` // Aspect Ratio value. Info string `json:"interpretation" xml:"interpretation,attr"` // A 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"` // Non-blink mode (iCE Color) toggle. Info string `json:"interpretation" xml:"interpretation,attr"` // A 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"` // Letter-spacing value. Info string `json:"interpretation" xml:"interpretation,attr"` // A 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"` // Flags value as an unsigned integer. Binary string `json:"binary" xml:"binary,attr"` // Flags value in binary notation. B ANSIFlagB `json:"nonBlinkMode" xml:"non_blink_mode"` // Non-blink mode (iCE Color) value. LS ANSIFlagLS `json:"letterSpacing" xml:"letter_spacing"` // Letter-spacing value. AR ANSIFlagAR `json:"aspectRatio" xml:"aspect_ratio"` // Aspect Ratio value. Interpretations string `json:"-" xml:"-"` // Humanized descriptions of the ANSIFlags 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"` // SAUCE comment block identification, this should be "COMNT" Count int `json:"count" xml:"count,attr"` // The reported number of lines in the SAUCE comment block. Index int `json:"-" xml:"-"` // The calculated starting position of the comment block. Comment []string `json:"lines" xml:"line"` // Lines of text, each line should be 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 Datas ¶
type Datas struct { Type TypeOfData `json:"type" xml:"type"` // A unsigned integer DataType. Name string `json:"name" xml:"name"` // Name of the DataType. }
Datas is the SAUCE DataType value and name.
type Dates ¶
type Dates struct { Value string `json:"value" xml:"value"` // SAUCE date format, CCYYMMDD (century, year, month, day). Time time.Time `json:"iso" xml:"date"` // Time as a time type. Epoch int64 `json:"epoch" xml:"epoch,attr"` // Unix time, 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 FileSize ¶
type FileSize [4]byte // The original file size not including the SAUCE information.
type Files ¶
type Files struct { Type TypeOfFile `json:"type" xml:"type"` // A unsigned integer FileType. Name string `json:"name" xml:"name"` // Name of the FileType. }
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"` // Size as bytes. Decimal string `json:"decimal" xml:"decimal,attr"` // Decimal returns the file size as a base 10 value. Binary string `json:"binary" xml:"binary,attr"` // Binary returns the file size as 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 // A character based file. Bitmaps // Bitmap graphic and animation files. Vectors // A vector graphic file. Audios // An audio file. BinaryTexts // This is a raw memory copy of a text mode screen. Also known as a .BIN file. XBins // An XBin or eXtended BIN file. Archives // An archive file. Executables // A executable file. )
func (TypeOfData) String ¶
func (d TypeOfData) String() string