package fileblock

import "github.com/codesoap/pbf/fileblock"

Index

Types

type Scanner

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

Scanner allows reading fileblocks from PBF files, one at a time.

func NewScanner

func NewScanner(file *os.File) Scanner

func (*Scanner) Blob

func (s *Scanner) Blob() *pbfproto.Blob

Blob returns the latest blob. May be nil if Scan has not been called or an unknown blob type has been encountered.

func (*Scanner) BlobHeader

func (s *Scanner) BlobHeader() *pbfproto.BlobHeader

func (*Scanner) BlobLocation

func (s *Scanner) BlobLocation() (start int64, size int32)

BlobLocation returns the start position and size of the latest blob in the PBF file.

func (*Scanner) Err

func (s *Scanner) Err() error

func (*Scanner) Scan

func (s *Scanner) Scan() bool

Scan reads the next fileblock, which can be retrieved with the BlobHeader and Blob functions. If it returns false, no new fileblock has been read. This is either because there are no more fileblocks or because there was an error. In the latter case, the Err method will return the encountered error.

Source Files

scanner.go

Version
v0.1.2 (latest)
Published
Oct 4, 2024
Platform
linux/amd64
Imports
5 packages
Last checked
2 weeks ago

Tools for package owners.