dptxt

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorIllegalCharBeforeSectionName = errors.New("セクション名の前に不正な文字があります。")
	ErrorNoSectionNamePrefix          = errors.New("セクション名プリフィックスがありません。")
	ErrorNoSectionNameSuffix          = errors.New("セクション名サフィックスがありません。")
	ErrorSectionNameIsEmpty           = errors.New("セクション名が空です。")
	ErrorUnexpectedText               = errors.New("予期しない入力文字列です。")
	ErrorInvalidDateFormat            = errors.New("日付の書式に誤りがあります。")
	ErrorNoMonthSpecified             = errors.New("日付の書式に誤りがあります。")
	ErrorNoDaySpecified               = errors.New("日付の書式に誤りがあります。")
	ErrorYearIsOutOfRange             = errors.New("日付の書式に誤りがあります。")
	ErrorMonthIsOutOfRange            = errors.New("日付の書式に誤りがあります。")
	ErrorDayIsOutOfRange              = errors.New("日付の書式に誤りがあります。")
	ErrorInvalidMonthSuffix           = errors.New("日付の書式に誤りがあります。")
	ErrorInvalidDaySuffix             = errors.New("日付の書式に誤りがあります。")
	ErrorUnknownDateSuffix            = errors.New("日付の書式に誤りがあります。")
	ErrorNoOpenParenthesis            = errors.New("日付を指定してください。")
	ErrorNoCloseParenthesis           = errors.New("日付を指定してください。")
	ErrorExtraTextAfterDate           = errors.New("日付を指定してください。")
)

エラーメッセージ

Functions

func DecodeDigit

func DecodeDigit(b []byte) ([]byte, int, rune, int)

func DecodeSingleDigit

func DecodeSingleDigit(b []byte) (rune, int, int)

func IndexFuncWithSize

func IndexFuncWithSize(b []byte, f func(r rune) bool) (int, int)

func LastIndexFuncWithSize

func LastIndexFuncWithSize(b []byte, f func(r rune) bool) (int, int)

func ParseDate

func ParseDate(b []byte) (int, int, int, []byte, error)

func ParseDocument

func ParseDocument(filename string, r io.Reader, doc *Document) error

func ParseLogDate

func ParseLogDate(b []byte) (int, int, int, []byte, []byte, error)

日付より前の部分と、カッコの中の日付より後ろの部分も返す。

Types

type Document

type Document struct {
	Filename string
	Sections map[string]*Section
	Error    error
}

func (*Document) String

func (d *Document) String() string

type Paragraph

type Paragraph struct {
	Linenum    int
	Value      [][]byte
	Error      error
	Time       *time.Time
	TimeSuffix []byte
}

func (*Paragraph) String

func (p *Paragraph) String() string

type ParseError

type ParseError struct {
	Filename string
	Line     int
	Err      error
}

func NewParseError

func NewParseError(filename string, linenum int, err error) *ParseError

func (*ParseError) Error

func (pe *ParseError) Error() string

func (*ParseError) Unwrap

func (pe *ParseError) Unwrap() error

type Section

type Section struct {
	Linenum int
	Value   []*Paragraph

	Error   error
	Expired bool
	Time    *time.Time
	Number  int64
	// contains filtered or unexported fields
}

func (*Section) PeekBytes

func (s *Section) PeekBytes() []byte

func (*Section) PeekString

func (s *Section) PeekString() string

func (*Section) String

func (s *Section) String() string

Jump to

Keyboard shortcuts

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