workbook

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RelationshipType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"
	ContentType      = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BookRelationship

type BookRelationship struct {
	XMLName xml.Name `xml:"Relationships"`

	RootNamespace string `xml:"xmlns,attr"`

	Relationships []Relationship
	// contains filtered or unexported fields
}

func NewBookRelationship

func NewBookRelationship() *BookRelationship

func (*BookRelationship) AddRelationship

func (w *BookRelationship) AddRelationship(rel Relationship) *BookRelationship

func (*BookRelationship) Filepath

func (w *BookRelationship) Filepath() string

func (*BookRelationship) Marshal

func (w *BookRelationship) Marshal() ([]byte, error)

func (*BookRelationship) NextRId

func (w *BookRelationship) NextRId() string

type BookView

type BookView struct {
	XMLName xml.Name `xml:"workbookView"`

	XWindow      int `xml:"xWindow,attr"`
	YWindow      int `xml:"yWindow,attr"`
	WindowWidth  int `xml:"windowWidth,attr"`
	WindowHeight int `xml:"windowHeight,attr"`
}

type BookViews

type BookViews struct {
	XMLName xml.Name `xml:"bookViews"`

	Views []BookView
	// contains filtered or unexported fields
}

func (*BookViews) AddView

func (b *BookViews) AddView(view BookView) *BookViews

type Relationship

type Relationship struct {
	XMLName xml.Name `xml:"Relationship"`

	// Id 关联的id
	Id string `xml:"Id,attr"`

	// Type 关联类型
	Type string `xml:"Type,attr"`

	// Target 目标位置
	Target string `xml:"Target,attr"`
}

Relationship 关联结构定义

type SheetTag

type SheetTag struct {
	XMLName xml.Name `xml:"sheet"`

	Name    string `xml:"name,attr"`
	SheetId string `xml:"sheetId,attr"`
	RId     string `xml:"r:id,attr"`
}

type Sheets

type Sheets struct {
	XMLName xml.Name `xml:"sheets"`

	Sheets []SheetTag
	// contains filtered or unexported fields
}

func (*Sheets) AddSheet

func (s *Sheets) AddSheet(sheetTag SheetTag, sheet *sheet.Sheet) *Sheets

func (*Sheets) GetSheets

func (s *Sheets) GetSheets() []*sheet.Sheet

func (*Sheets) SheetNum

func (s *Sheets) SheetNum() int

type Workbook

type Workbook struct {
	XMLName xml.Name `xml:"workbook"`

	RootNamespace         string `xml:"xmlns,attr"`
	RelationshipNamespace string `xml:"xmlns:r,attr"`

	Views  *BookViews
	Sheets *Sheets
}

func NewWorkbook

func NewWorkbook() *Workbook

func (*Workbook) AddView

func (w *Workbook) AddView(view BookView) *Workbook

func (*Workbook) Filepath

func (w *Workbook) Filepath() string

func (*Workbook) Marshal

func (w *Workbook) Marshal() ([]byte, error)

func (*Workbook) NewSheet

func (w *Workbook) NewSheet(rId string) *sheet.Sheet

func (*Workbook) NewSheetWithName

func (w *Workbook) NewSheetWithName(name, rId string) *sheet.Sheet

func (*Workbook) SheetNum

func (w *Workbook) SheetNum() int

Jump to

Keyboard shortcuts

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