iarewp

package module
v0.0.0-...-423135d Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2017 License: MIT Imports: 3 Imported by: 0

README

iarewp

Go library for interacting with IAR's EWP files. The library has no affiliation with IAR. The library provides means of marshalling / unmarshalling EWP files.

go get github.com/IQ-Inc/iarewp

Documentation

Overview

Package iarewp defines a library for interacting with IAR's EWP files.

Notes:

- The library does not contain routines for interacting with configurations or file groups. The structs maintain the data as raw, unmarshalled XML. The library provides no means of interacting with the data.

- The library has no affiliation with IAR.

Ian McIntyre

Index

Constants

View Source
const (
	// ProjectDir is the project directory prefix for file paths
	ProjectDir string = "$PROJ_DIR$"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ByFileName

type ByFileName []File

ByFileName wraps a slice of files for sorting by file name

func (ByFileName) Len

func (fs ByFileName) Len() int

Len is a method of the sort interface

func (ByFileName) Less

func (fs ByFileName) Less(i, j int) bool

Less is a method of the sort interface

func (ByFileName) Swap

func (fs ByFileName) Swap(i, j int)

Swap is a method of the sort interface

type Ewp

type Ewp struct {
	XMLName xml.Name `xml:"project"`

	// FileVersion is the EWP file version
	FileVersion int `xml:"fileVersion"`

	// Configuration is the configuration tags.
	// They are unused, so we consume all the inner structure
	Configuration []struct {
		Unused string `xml:",innerxml"`
	} `xml:"configuration"`

	// Group is the file groups. Also unused, so we
	// consume all the inner XML here.
	Group []struct {
		Unused string `xml:",innerxml"`
	} `xml:"group"`

	// Files is a list of files
	Files []File `xml:"file"`
}

Ewp the top-level type of the EWP

func (*Ewp) Contains

func (ewp *Ewp) Contains(f File) bool

Contains checks if the provided file is in the EWP

func (*Ewp) InsertFile

func (ewp *Ewp) InsertFile(f File)

InsertFile will insert a file into an EWP while maintaining file order

type Excluded

type Excluded struct {
	Configurations []string `xml:"configuration"`
}

Excluded defines the configurations that omit the file

type File

type File struct {
	// Name is the file name
	Name string `xml:"name"`

	// Excluded is an optional struct that defines
	// the configurations from which the file is
	// excluded.
	Exclusions *Excluded `xml:"excluded,omitempty"`
}

File defines the file

func MakeFile

func MakeFile(name string, exclusions ...string) File

MakeFile creates a file with zero (nil) or more exclusions

func (*File) FileName

func (f *File) FileName() string

FileName gets the name of the file

Jump to

Keyboard shortcuts

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