Documentation ¶
Index ¶
- func ConvGBKToUTF8(s []byte) ([]byte, error)
- func ConvUTF8ToGBK(s []byte) ([]byte, error)
- func GetSheetValueString(sheet *xlsx.Sheet, row, col int) string
- func IsFullRowEmpty(sheet *xlsx.Sheet, row int) bool
- func ReadSheetRow(sheet TableSheet, row int) (ret []string)
- func WriteFile(filename string, data []byte) error
- func WriteIndexTableHeader(sheet TableSheet)
- func WriteRowValues(sheet TableSheet, valueList ...string)
- func WriteTypeTableHeader(sheet TableSheet)
- type CSVFile
- type CSVSheet
- func (self *CSVSheet) GetValue(row, col int, opt *ValueOption) string
- func (self *CSVSheet) IsRowEmpty(row, maxCol int) bool
- func (self *CSVSheet) MaxColumn() int
- func (self *CSVSheet) Name() string
- func (self *CSVSheet) SetValue(row, col int, value string) bool
- func (self *CSVSheet) WriteRow(valueList ...string)
- type FileGetter
- type FileLoader
- type MemFile
- func (self *MemFile) AddFile(filename string, file TableFile) (ret *MemFileData)
- func (self *MemFile) CreateCSVFile(filename string) TableSheet
- func (self *MemFile) CreateXLSXFile(filename string) TableSheet
- func (self *MemFile) GetFile(filename string) (TableFile, error)
- func (self *MemFile) VisitAllTable(callback func(data *MemFileData) bool)
- type MemFileData
- type TableFile
- type TableSheet
- type ValueOption
- type XlsxFile
- type XlsxSheet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvGBKToUTF8 ¶
func ConvUTF8ToGBK ¶
func ReadSheetRow ¶
func ReadSheetRow(sheet TableSheet, row int) (ret []string)
func WriteIndexTableHeader ¶
func WriteIndexTableHeader(sheet TableSheet)
func WriteRowValues ¶
func WriteRowValues(sheet TableSheet, valueList ...string)
func WriteTypeTableHeader ¶
func WriteTypeTableHeader(sheet TableSheet)
Types ¶
type CSVFile ¶
type CSVFile struct { Name string // contains filtered or unexported fields }
func NewCSVFile ¶
func NewCSVFile() *CSVFile
func (*CSVFile) Sheets ¶
func (self *CSVFile) Sheets() (ret []TableSheet)
type CSVSheet ¶
type CSVSheet struct {
// contains filtered or unexported fields
}
func (*CSVSheet) IsRowEmpty ¶
type FileGetter ¶
type FileLoader ¶
type FileLoader struct { UseGBKCSV bool // contains filtered or unexported fields }
func NewFileLoader ¶
func NewFileLoader(syncLoad bool, cacheDir string) *FileLoader
func (*FileLoader) AddFile ¶
func (self *FileLoader) AddFile(filename string)
func (*FileLoader) Commit ¶
func (self *FileLoader) Commit()
type MemFile ¶
type MemFile struct {
// contains filtered or unexported fields
}
func NewMemFile ¶
func NewMemFile() *MemFile
func (*MemFile) AddFile ¶
func (self *MemFile) AddFile(filename string, file TableFile) (ret *MemFileData)
func (*MemFile) CreateCSVFile ¶
func (self *MemFile) CreateCSVFile(filename string) TableSheet
func (*MemFile) CreateXLSXFile ¶
func (self *MemFile) CreateXLSXFile(filename string) TableSheet
func (*MemFile) VisitAllTable ¶
func (self *MemFile) VisitAllTable(callback func(data *MemFileData) bool)
type MemFileData ¶
type TableFile ¶
type TableFile interface { Load(filename string) error // 保存到文件 Save(filename string) error // 获取所有表单 Sheets() []TableSheet }
func ConvertToCSV ¶
func NewXlsxFile ¶
type TableSheet ¶
type ValueOption ¶
type ValueOption struct {
ValueAsFloat bool
}
type XlsxFile ¶
type XlsxFile struct {
// contains filtered or unexported fields
}
func (*XlsxFile) Sheets ¶
func (self *XlsxFile) Sheets() (ret []TableSheet)
type XlsxSheet ¶
func (*XlsxSheet) GetValue ¶
func (self *XlsxSheet) GetValue(row, col int, opt *ValueOption) (ret string)
func (*XlsxSheet) IsRowEmpty ¶
Click to show internal directories.
Click to hide internal directories.