normalize

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 GetCompiledPath

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

func GetLongPathFixed

func GetLongPathFixed(givenAbsolutePath string, isForce bool) string

Adds constants.LongPathQuestionMarkPrefix if path is longer than 255 and doesn't already contains it. Ignores prefix apply if already has it (constants.LongPathUncPrefix or constants.LongPathQuestionMarkPrefix ) or path is empty or length less than 255 if path starts with `\\` then replaces with constants.LongPathUncPrefix

func GetLongPathFixedPtr

func GetLongPathFixedPtr(
	separator string,
	givenAbsolutePath string,
	isForce bool,
) string

Adds constants.LongPathQuestionMarkPrefix if path is longer than 255 and doesn't already contains it. Ignores prefix apply if already has it (constants.LongPathUncPrefix or constants.LongPathQuestionMarkPrefix ) or path is empty or length less than 255 if path starts with `\\` then replaces with constants.LongPathUncPrefix

func Path

func Path(givenPath string) string

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

func PathUsingSeparator

func PathUsingSeparator(
	pathSeparator,
	givenPath string,
	isLongPathFix bool,
	isForceLongPath bool,
) string

Always returns path without the separator at the end. Separator must be one char. Long path fix will not be applied other than Windows operating system.

func PathUsingSeparatorIf

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

func PathUsingSeparatorUsingSingleIf

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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