id

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Index

func Index(i int, l List) (int, error)

Index returns the index of 'ID' inside 'l'. If 'ID' is not inside 'l' Index() returns 0 and an error.

func ZeroSourceTreeIds

func ZeroSourceTreeIds(srcRoot string, run bool)

ZeroSourceTreeIds is overwriting with 0 all id's from source code tree srcRoot. It does not touch idlist.

Types

type Item

type Item struct {
	ID      int    `json:"id"`      // identifier
	FmtType string `json:"fmtType"` // format type (bitsize and number of fmt string parameters)
	FmtStrg string `json:"fmtStrg"` // format string
	Created int32  `json:"created"` // utc unix time of creation
	Removed int32  `json:"removed"` // utc unix time of disappearing in processed src directory
}

Item is the basic element

type List

type List []Item

List is a slice type containing the ID list

func (*List) Read

func (p *List) Read(fn string) error

Read is reading a JSON file fn and returning a slice

func (*List) Update

func (p *List) Update(root, fn string, run bool) error

Update is parsing source tree root and performing these actions: - replace FmtType( Id(0), ...) with FmtType( Id(n), ...) - find duplicate FmtType( Id(n), ...) and replace one of them if trices are not identical - extend file fnIDList

Jump to

Keyboard shortcuts

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