normalize

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WindowsPathSeparator = constants.BackSlash
	UnixPathSeparator    = constants.ForwardSlash
)

Variables

View Source
var (
	PathSeparatorChar = byte(os.PathSeparator)
)

Functions

func ChangeDoubleBackSlash

func ChangeDoubleBackSlash(path, changeSeparator string) string

func ChangeDoubleForwardSlash

func ChangeDoubleForwardSlash(path, changeSeparator string) string

func ChangeSeparator

func ChangeSeparator(
	path,
	currentSeparator,
	changeSeparator string,
) string

func DbPath added in v0.3.9

func DbPath(path string) string

func GetCompiledPath

func GetCompiledPath(
	pathTemplate string,
	compilingMap map[string]string,
) string

func GetFilterPathsInfoMap added in v0.1.3

func GetFilterPathsInfoMap(
	isNormalize,
	isSkipOnInvalid bool,
	locations []string,
) *chmodhelper.FilteredPathFileInfoMap

func HasPrefix added in v0.5.1

func HasPrefix(cleanedPrefix, cleanAbsolutePath string) bool

HasPrefix returns true if contains prefix

func JoinNormalizedPaths added in v0.1.3

func JoinNormalizedPaths(
	baseLocation string,
	locations ...string,
) string

func LongPathFixPlusClean added in v0.4.6

func LongPathFixPlusClean(
	isForceLongPathFix bool,
	givenPath string,
) string

func Path

func Path(givenPath string) string

Path By default apply long path fix and regular normalize using os.PathSeparator

func PathFixWithoutLongPathIf added in v0.3.9

func PathFixWithoutLongPathIf(
	isNormalize bool,
	givenPath string,
) string

func PathIf added in v0.5.2

func PathIf(
	isNormalize bool,
	givenPath string,
) string

func PathUsingSeparatorIf

func PathUsingSeparatorIf(
	isForceLongPath,
	isLongPathFix,
	isNormalize bool,
	pathSeparator,
	givenPath string,
) string

func PathUsingSeparatorUsingSingleIf

func PathUsingSeparatorUsingSingleIf(
	isNormalizeLongPathForce bool,
	pathSeparator,
	givenPath string,
) string

func PathUsingSingleIf added in v0.1.3

func PathUsingSingleIf(
	isNormalizeLongPathForce bool,
	givenPath string,
) string

func PathsOnConditions added in v0.1.2

func PathsOnConditions(isNormalize bool, locations []string) []string

func PathsUsingOptions added in v0.4.0

func PathsUsingOptions(
	options *Options,
	locations []string,
) []string

func PathsUsingOptionsAsync added in v0.4.0

func PathsUsingOptionsAsync(
	options *Options,
	locations ...string,
) []string

func PathsUsingSingleIf added in v0.1.3

func PathsUsingSingleIf(
	isNormalizeLongPathForce bool,
	locations []string,
) []string

func PathsUsingSingleIfAsync added in v0.1.3

func PathsUsingSingleIfAsync(
	isNormalizeLongPathForce bool,
	locations []string,
) []string

func SimpleBaseDirJoinPaths added in v0.4.0

func SimpleBaseDirJoinPaths(baseDir string, locations ...string) string

func SimpleJoinPath added in v0.4.0

func SimpleJoinPath(path1, path2 string) string

func SimpleJoinPath3 added in v0.4.0

func SimpleJoinPath3(path1, path2, path3 string) string

func SimpleJoinPaths added in v0.4.0

func SimpleJoinPaths(locations ...string) string

func TrimPrefixRoot added in v0.4.3

func TrimPrefixRoot(
	source,
	rootTrimmingPrefix string,
) string

func TrimPrefixUncPath added in v0.4.0

func TrimPrefixUncPath(
	givenPath string,
) string

func TrimPrefixUncPathIf added in v0.4.3

func TrimPrefixUncPathIf(
	isSkipOnUnix bool,
	givenPath string,
) string

func TrimPrefixUncPaths added in v0.4.3

func TrimPrefixUncPaths(
	isSkipOnUnix bool,
	locations ...string,
) []string

func TrimPrefixes added in v0.4.0

func TrimPrefixes(
	givenPath string,
	trimPrefixes ...string,
) string

Types

type Options added in v0.4.0

type Options struct {
	IsNormalize,
	IsLongPathFix,
	IsForceLongPathFix bool
}

func NewOptionsAllTrue added in v0.4.0

func NewOptionsAllTrue() *Options

func (Options) FixPath added in v0.4.0

func (it Options) FixPath(path string) string

func (Options) IsAllOptionsDisabled added in v0.4.0

func (it Options) IsAllOptionsDisabled() bool

func (Options) JoinPath added in v0.4.0

func (it Options) JoinPath(path1, path2 string) string

func (Options) JoinPath3 added in v0.4.0

func (it Options) JoinPath3(path1, path2, path3 string) string

func (Options) JoinPaths added in v0.4.0

func (it Options) JoinPaths(locations ...string) string

func (Options) JoinWithBaseDirPaths added in v0.4.0

func (it Options) JoinWithBaseDirPaths(
	baseDir string, locations ...string,
) string

Jump to

Keyboard shortcuts

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