parse

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2025 License: MIT Imports: 14 Imported by: 0

README

Parse

structure

Documentation

Index

Constants

View Source
const (
	LittleEndian = util.LittleEndian
	BigEndian    = util.BigEndian
	NativeEndian = util.NativeEndian
)

Variables

This section is empty.

Functions

func Mo

func Mo(path string, opts ...MoOption) (*po.File, error)

func MoFromBytes

func MoFromBytes(b []byte, name string, opts ...MoOption) (*po.File, error)

func MoFromFile

func MoFromFile(f *os.File, opts ...MoOption) (*po.File, error)

func MoFromReader

func MoFromReader(r io.Reader, name string, opts ...MoOption) (*po.File, error)

func Po

func Po(path string, opts ...PoOption) (*po.File, error)

Parse directly the provided file.

func PoFromBytes

func PoFromBytes(b []byte, name string, opts ...PoOption) (*po.File, error)

func PoFromFile

func PoFromFile(f *os.File, opts ...PoOption) (*po.File, error)

func PoFromReader

func PoFromReader(r io.Reader, name string, opts ...PoOption) (*po.File, error)

func PoFromString

func PoFromString(s, name string, opts ...PoOption) (*po.File, error)

Types

type Endianness added in v2.3.0

type Endianness = util.Endianness

type MoConfig added in v2.3.0

type MoConfig struct {
	Endianness Endianness
	// contains filtered or unexported fields
}

func DefaultMoConfig added in v2.3.0

func DefaultMoConfig(opts ...MoOption) MoConfig

func (*MoConfig) ApplyOptions added in v2.3.0

func (mc *MoConfig) ApplyOptions(opts ...MoOption)

func (*MoConfig) RestoreLastCfg added in v2.3.0

func (mc *MoConfig) RestoreLastCfg()

type MoOption added in v2.3.0

type MoOption func(*MoConfig)

func MoWithConfig added in v2.3.0

func MoWithConfig(c MoConfig) MoOption

func MoWithEndianness added in v2.3.0

func MoWithEndianness(e Endianness) MoOption

type MoParser

type MoParser struct {
	Config MoConfig
	// contains filtered or unexported fields
}

func NewMo

func NewMo(path string, opts ...MoOption) (*MoParser, error)

func NewMoFromBytes

func NewMoFromBytes(b []byte, name string, opts ...MoOption) *MoParser

func NewMoFromFile

func NewMoFromFile(f *os.File, opts ...MoOption) (*MoParser, error)

func NewMoFromReader

func NewMoFromReader(r io.Reader, name string, opts ...MoOption) (*MoParser, error)

func (MoParser) Error

func (m MoParser) Error() error

Return the first error in the stack.

func (MoParser) Errors

func (m MoParser) Errors() []error

func (*MoParser) Parse

func (m *MoParser) Parse() (file *po.File)

func (*MoParser) ParseWithOptions added in v2.3.0

func (m *MoParser) ParseWithOptions(opts ...MoOption) (file *po.File)

type PoConfig

type PoConfig struct {
	IgnoreComments    bool
	IgnoreAllComments bool
	Logger            *log.Logger
	SkipHeader        bool
	CleanDuplicates   bool

	ParseObsoletes          bool
	UseCustomObsoletePrefix bool
	CustomObsoletePrefix    rune
	// contains filtered or unexported fields
}

func DefaultPoConfig

func DefaultPoConfig(opts ...PoOption) PoConfig

func (*PoConfig) ApplyOptions

func (p *PoConfig) ApplyOptions(opts ...PoOption)

func (*PoConfig) RestoreLastCfg

func (p *PoConfig) RestoreLastCfg()

type PoOption

type PoOption func(*PoConfig)

func PoWithCleanDuplicates

func PoWithCleanDuplicates(cd bool) PoOption

func PoWithConfig

func PoWithConfig(cfg PoConfig) PoOption

func PoWithCustomObsoletePrefix

func PoWithCustomObsoletePrefix(r rune) PoOption

func PoWithIgnoreAllComments

func PoWithIgnoreAllComments(iag bool) PoOption

func PoWithIgnoreComments

func PoWithIgnoreComments(ig bool) PoOption

func PoWithLogger

func PoWithLogger(logger *log.Logger) PoOption

func PoWithParseObsolete

func PoWithParseObsolete(p bool) PoOption

func PoWithSkipHeader

func PoWithSkipHeader(s bool) PoOption

func PoWithUseCustomObsoletePrefix

func PoWithUseCustomObsoletePrefix(u bool) PoOption

type PoParser

type PoParser struct {
	Config PoConfig
	// contains filtered or unexported fields
}

func NewPo

func NewPo(path string, options ...PoOption) (*PoParser, error)

func NewPoFromBytes

func NewPoFromBytes(data []byte, name string, options ...PoOption) *PoParser

func NewPoFromFile

func NewPoFromFile(f *os.File, options ...PoOption) (*PoParser, error)

func NewPoFromReader

func NewPoFromReader(r io.Reader, name string, options ...PoOption) (*PoParser, error)

func NewPoFromString

func NewPoFromString(s, name string, options ...PoOption) *PoParser

func (PoParser) Error

func (p PoParser) Error() error

Return the first error in the stack.

func (PoParser) Errors

func (p PoParser) Errors() []error

func (*PoParser) Parse

func (p *PoParser) Parse() *po.File

func (*PoParser) ParseWithOptions

func (p *PoParser) ParseWithOptions(opts ...PoOption) *po.File

func (PoParser) Warnings

func (p PoParser) Warnings() []error

Jump to

Keyboard shortcuts

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