format

package
v0.0.0-...-5a6d1e8 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2019 License: MIT Imports: 3 Imported by: 62

Documentation

Overview

DXF Output Formatter

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ASCII

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

ASCII is Formatter for ASCII format.

func NewASCII

func NewASCII() *ASCII

NewASCII creates a new ASCII formatter.

func (*ASCII) Float

func (f *ASCII) Float(num int, val float64) string

Float outputs given code & floating point in DXF format.

func (*ASCII) Hex

func (f *ASCII) Hex(num int, h int) string

Hex outputs given code & hex in DXF format. It is used for outputting handles.

func (*ASCII) Int

func (f *ASCII) Int(num int, val int) string

Int outputs given code & int in DXF format.

func (*ASCII) Output

func (f *ASCII) Output() string

Output outputs data stored in the buffer in DXF format.

func (*ASCII) Reset

func (f *ASCII) Reset()

Reset resets the buffer.

func (*ASCII) SetPrecision

func (f *ASCII) SetPrecision(p int)

SetPrecision sets precision part for outputting floating point values.

func (*ASCII) String

func (f *ASCII) String(num int, val string) string

String outputs given code & string in DXF format.

func (*ASCII) WriteFloat

func (f *ASCII) WriteFloat(num int, val float64)

WriteFloat appends floating point data to the buffer.

func (*ASCII) WriteHex

func (f *ASCII) WriteHex(num int, h int)

WriteHex appends hex data to the buffer.

func (*ASCII) WriteInt

func (f *ASCII) WriteInt(num int, val int)

WriteInt appends int data to the buffer.

func (*ASCII) WriteString

func (f *ASCII) WriteString(num int, val string)

WriteString appends string data to the buffer.

func (*ASCII) WriteTo

func (f *ASCII) WriteTo(w io.Writer) (int64, error)

WriteTo writes data stored in the buffer to w.

type Formatter

type Formatter interface {
	Reset()
	WriteTo(w io.Writer) (int64, error)
	SetPrecision(p int)
	Output() string
	String(num int, val string) string
	Hex(num int, h int) string
	Int(num int, val int) string
	Float(num int, val float64) string
	WriteString(num int, val string)
	WriteHex(num int, h int)
	WriteInt(num int, val int)
	WriteFloat(num int, val float64)
}

Formatter controls output format.

Jump to

Keyboard shortcuts

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