cvt2sif

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TrvsGrpViaSpec []string // from SIF Spec

	RewindAttrIter = func() {
		for k := range mPathAttrIdx {
			mPathAttrIdx[k] = 0
		}
	}

	ResetPrt = func() {
		mOAPrtLn = make(map[string]int)
	}

	ResetAll = func() {
		mObjIdxStart = make(map[string]int)
		mObjIdxEnd = make(map[string]int)
		mOAPrtLn = make(map[string]int)
		mIPathSubXML = make(map[string]string)
		mIPathSubMark = make(map[string]string)
		mPathIdx = make(map[string]int)
	}
)

Functions

func CountHeadSpace

func CountHeadSpace(s string, nGrp int) int

CountHeadSpace :

func ExtractOA

func ExtractOA(xml, obj, path string, lvl int) string

ExtractOA : root obj, path is ""

func Hierarchy

func Hierarchy(searchArea string, lvl int, hierarchy *[]string)

Hierarchy :

func Indent

func Indent(str string, n int, ign1stLn bool) (string, bool)

Indent :

func InitOAs

func InitOAs(SIFSpecPath string, tblSep, pathSep string)

InitOAs : fill TrvsGrpViaSpec & [mPathAttrs] & [mPathAttrIdx]

func JSON2SIF

func JSON2SIF(cfgPath, json, SIFVer string) (sif, sv string, err error)

JSON2SIF : JSON2SIF4LF -> JSON2SIF3RD -> JSON2SIFSpec -> JSON2SIFRepl

func JSON2SIF3RD

func JSON2SIF3RD(jsonstr string) string

JSON2SIF3RD : via 3rd lib converter, return Disordered, Formatted XML

func JSON2SIF4LF

func JSON2SIF4LF(json string) (string, map[string]string)

JSON2SIF4LF : if JSON fields have special (LF, TBL), pick them up for later replacement

func JSON2SIFRepl

func JSON2SIFRepl(xml string, mRepl map[string]string) string

JSON2SIFRepl : Pieces Replaced, should be almost identical to Original SIF

func JSON2SIFSpec

func JSON2SIFSpec(xml, SIFSpecPath string) string

JSON2SIFSpec : Ordered, Some pieces are different

func NextAttr

func NextAttr(obj, fullpath string) (value string, end bool)

NextAttr : From Spec

func PrintXML

func PrintXML(paper, line, mark string, iLine int, tag string) (string, bool)

PrintXML : append print to a string

func SearchTagWithAttr

func SearchTagWithAttr(xml string) (posGrp [][2]int, pathGrp []string, mAttrGrp []map[string]string, root string)

SearchTagWithAttr : where (get line from xml), tag-path (get info from spec), attribute-map (re-order attributes, reconstruct line)

func SortSimpleObject

func SortSimpleObject(xml, obj string, level int, trvsPath string) (paper string)

SortSimpleObject : xml is 4 space formatted, level is obj level obj [level] = attribute [level-1] NextAttr is available

func TagFromXMLLine

func TagFromXMLLine(line string) (tag string, mKeyAttr map[string]string)

TagFromXMLLine :

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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