Documentation ¶
Index ¶
- Constants
- Variables
- func AllFilesInPath(path string) (filenames []string)
- func Basename(fn string) (bn string)
- func BasenameExt(fn string) (bn string)
- func ChkOrBlank(v bool) string
- func ChkOrX(v bool) string
- func CompareFiles(cmpFile string, refFile string) bool
- func CompareSlices(X, Y []int) []int
- func ConvertActionFlagToString(kk int) (rv string)
- func CopyFile(src, dst string, useHardLink bool) (err error)
- func DbFprintf(db string, w io.Writer, format string, args ...interface{})
- func DbOn(db string) (ok bool)
- func DbPrintf(db string, format string, args ...interface{})
- func DirExists(name string) bool
- func EqualStringSlices(X, Y []string) bool
- func EscapeStr(v string, on bool) string
- func Exists(name string) bool
- func FILE(d ...int) (rv string)
- func FilterArray(re string, inArr []string) (outArr []string)
- func Fopen(fn string, mode string) (file *os.File, err error)
- func GetFilenames(dir string) (filenames, dirs []string)
- func GetFilenamesRecrusive(dir string) (filenames, dirs []string, err error)
- func GetTemplateFiles(dir string) (fns []string, err error)
- func InArray(lookFor string, inArr []string) bool
- func KeyStringSort(str []string) (rv []string)
- func LF(d ...int) (rv string)
- func LINE(d ...int) (rv string)
- func LINEn(d ...int) (rv int)
- func NameOf(inputSet []int) string
- func ParseBool(s string) (b bool)
- func Qt(format string, data map[string]string) string
- func QtR(format string, data map[string]interface{}) string
- func ReplaceEach(data []string, pat, repl string) (outArr []string)
- func RmExt(filename string) string
- func SVar(v interface{}) string
- func SVarI(v interface{}) string
- func SortMapStringString(str map[string]string) (rv []string)
- func StashError(s string)
- func USortIntSlice(inputSet []int) (rv []int)
- type ErrorBufferType
Constants ¶
const ( A_Repl = 1 << iota // Replace input that matches with this - acts as a hard token A_EOF = 1 << iota // Reached EOF A_Push = 1 << iota // Call(x) A_Pop = 1 << iota // Return A_Observe = 1 << iota // Observe and report occurance of an item, continue processing A_Greedy = 1 << iota // not used A_Reset = 1 << iota // Reset stack to top level - restart machine (error recovery) A_NotGreedy = 1 << iota // Report token if if could be greedy and accumulate A_Error = 1 << iota // Have an Error to report - often combined with A_Reset A_Warning = 1 << iota // A warning to report A_Alias = 1 << iota // An alias - replaces input and processes as if this was the original input (Different than A_Repl) )
Variables ¶
var ( Red = ansi.ColorCode("red") Yellow = ansi.ColorCode("yellow") Green = ansi.ColorCode("green") Reset = ansi.ColorCode("reset") )
var DbOnFlags map[string]bool
------------------------------------------------------------------------------------------------------------------------------------------ Debug Print - controllable with flags. ------------------------------------------------------------------------------------------------------------------------------------------
var DbOnFlagsLock sync.Mutex
var ReservedActionNames = []string{"A_Repl", "A_EOF", "A_Push", "A_Pop", "A_Observe", "A_Greedy", "A_Reset", "A_NotGreedy", "A_Error", "A_Warning", "A_Alias"}
var ReservedActionToString map[int]string
Functions ¶
func AllFilesInPath ¶
----------------------------------------------------------------------------------------------------------------------------------- Generate an array with all the files in the path -----------------------------------------------------------------------------------------------------------------------------------
func Basename ¶
------------------------------------------------------------------------------------------------- xyzzy - str. Return the basename from a file path. This is the last component with the directory path stripped off. File extension removed. -------------------------------------------------------------------------------------------------
func BasenameExt ¶
------------------------------------------------------------------------------------------------- xyzzy - str. With file extension -------------------------------------------------------------------------------------------------
func ChkOrBlank ¶
func CompareFiles ¶
------------------------------------------------------------------------------------------------- xyzzy - need "fast" version of "CompareFiles" with some limits on what it will use "fast" compare for - .jpg,.gif,.png fiels - a fiel size before uses fast etc. Compare Size? Compare name? What is the "fast" compare for rsync? -- Calculate Hashes for each and keep them around? -------------------------------------------------------------------------------------------------
func CompareSlices ¶
func CopyFile ¶
CopyFile copies a file from src to dst. If src and dst files exist, and are the same, then return success. Otherise, if useHardLink is true, an attempt to create a hard link between the two files. If that fail, copy the file contents from src to dst.
func DirExists ¶
----------------------------------------------------------------------------------------------------------------------------------- Exists reports whether the named file or directory exists. -----------------------------------------------------------------------------------------------------------------------------------
func EqualStringSlices ¶
func EscapeStr ¶
------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------
func Exists ¶
------------------------------------------------------------------------------------------------- Exists reports whether the named file or directory exists. -------------------------------------------------------------------------------------------------
func FilterArray ¶
------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------
func GetFilenames ¶
------------------------------------------------------------------------------------------------- Get a list of filenames and directorys. -------------------------------------------------------------------------------------------------
func GetFilenamesRecrusive ¶
------------------------------------------------------------------------------------------------- Get a list of filenames and directories. -------------------------------------------------------------------------------------------------
func GetTemplateFiles ¶
------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------
func KeyStringSort ¶
func LINE ¶
---------------------------------------------------------------------------------------------------------- Return the current line number as a string.
func Qt ¶
QT: Quick template %{name%} gets replace with substitution from map if it is in map, else ""
func ReplaceEach ¶
------------------------------------------------------------------------------------------------- 1. For each dir - Create destination directies -o <name>/+/... ReplaceEach ( []string, pat, repl ) -------------------------------------------------------------------------------------------------
func SVar ¶
func SVar(v interface{}) string
-------------------------------------------------------------------------------------------------
func SVarI ¶
func SVarI(v interface{}) string
-------------------------------------------------------------------------------------------------
func SortMapStringString ¶
func StashError ¶
func StashError(s string)