зеркало из https://github.com/softlandia/xlib.git
defc4596cf | ||
---|---|---|
README.md | ||
cover.html | ||
cover.out | ||
test.txt | ||
test2.txt | ||
test3.txt | ||
utils.go | ||
xFileUtil.go | ||
xFileUtil_test.go | ||
xStrUtil.go | ||
xStrUtil_test.go |
README.md
golang util library
download: go get -u github.com/softlandia/xLib install: go install
dependences
"golang.org/x/text/encoding/charmap"
"golang.org/x/text/transform"
functions
- FileExists(name string) bool
- StrContainBackSlash(s string) bool
- StrIsPrintRune(s string) bool
- ChangeFileExt(iFileName, newExt string) string
- SeekFileToString(fileName, strToSearch string) (*bufio.Scanner, error)
- CodePageDetect(fn string) (int, error)
- ConvertStrCodePage(s string, fromCP, toCP int64) (string, error)
description
func FileExists(name string) bool
return true if file exist
func StrContainBackSlash(s string) bool
return true if string s consist rune back slash '\'
func StrIsPrintRune(s string) bool
return true if input string consists only of printable rune
func ChangeFileExt(iFileName, newExt string) string
return file name with new extention
func SeekFileToString(fileName, strToSearch string) (*bufio.Scanner, error)
read text file fileName and return Scanner at line strToSearch
func CodePageDetect(fn string, stopStr ...string) (int, error)
read text file fn and return code page, detect only IBM CodePage866 and Windows1251
return constant Cp866, Cp1251, CpEmpty
if string stopStr is present then input file scanned befor appearance stopStr
func ConvertStrCodePage(s string, fromCP, toCP int64) (string, error)
convert string from one code page to another
func FindFilesExt(fileList *[]string, path, fileNameExt string) (int, error)
search in path files with extention == fielNameExt and put file name to slice fileList