pathjoin

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentDirectory added in v0.3.9

func CurrentDirectory() string

func DbPath added in v0.4.1

func DbPath(path1, path2 string) string

func DbPaths added in v0.4.1

func DbPaths(locations ...string) string

func FilePathOfCaller added in v0.3.9

func FilePathOfCaller(callerIndex int) string

func FixPath added in v0.2.7

func FixPath(
	isNormalizePlusLogPathFix,
	isExpand bool,
	location string,
) string

FixPath normalized or expand or both apply based on condition

func FixPathPtr added in v0.3.8

func FixPathPtr(
	isNormalizePlusLogPathFix,
	isExpand bool,
	location string,
) *string

FixPathPtr normalized or expand or both apply based on condition

func JoinBaseDirWithSep added in v0.2.5

func JoinBaseDirWithSep(
	isSkipEmpty,
	isExpandEnvVariables,
	isNormalizePlusLongPathFix bool,
	sep string,
	baseDir string,
	paths ...string,
) string

JoinBaseDirWithSep isNormalizePlusLongPathFix if true then for windows add UNC Location fix

Omits baseDir if not given

func JoinConditionalNormalized3ExpandIf added in v0.2.7

func JoinConditionalNormalized3ExpandIf(
	isNormalizePlusLongPathFix,
	isExpand bool,
	path1, path2, path3 string,
) string

JoinConditionalNormalized3ExpandIf normalized or expand or both apply based on condition

func JoinConditionalNormalizedExpandIf added in v0.2.6

func JoinConditionalNormalizedExpandIf(
	isNormalizePlusLongPathFix,
	isExpand bool,
	path1, path2 string,
) string

JoinConditionalNormalizedExpandIf normalized or expand or both apply based on condition

func JoinFix added in v0.3.9

func JoinFix(
	baseDir string,
	paths ...string,
) string

JoinFix

Items are applied with normalize, skip on empty path given

func JoinFixWithoutLongPath added in v0.3.9

func JoinFixWithoutLongPath(
	baseDir string,
	paths ...string,
) string

JoinFixWithoutLongPath

Items are applied with normalize, skip on empty path given

func JoinFixed3 added in v0.4.0

func JoinFixed3(
	path1,
	path2,
	path3 string,
) string

func JoinFixedIf added in v0.4.0

func JoinFixedIf(
	isFixed bool,
	baseDir string,
	paths ...string,
) string

JoinFixedIf

isNormalizePlusLongPathFix if true then for windows add UNC Location fix

func JoinIf added in v0.3.3

func JoinIf(isNormalizePlusLongPathFix bool, path1, path2 string) string

JoinIf isNormalizePlusLongPathFix if true then for windows add UNC Location fix

func JoinNormalized

func JoinNormalized(
	path1, path2 string,
) string

JoinNormalized normalized applied auto

func JoinNormalized3

func JoinNormalized3(path1, path2, path3 string) string

JoinNormalized3 normalized applied auto

func JoinNormalized3ExpandIf added in v0.2.5

func JoinNormalized3ExpandIf(
	isExpandNormalize bool,
	path1, path2, path3 string,
) string

JoinNormalized3ExpandIf normalized and expand applied if condition meets

func JoinNormalized3If added in v0.1.2

func JoinNormalized3If(
	isNormalize bool,
	path1, path2, path3 string,
) string

JoinNormalized3If normalized applied auto

func JoinNormalizedExpand added in v0.2.5

func JoinNormalizedExpand(
	path1, path2 string,
) string

JoinNormalizedExpand normalized and expand applied auto

func JoinNormalizedExpand3 added in v0.2.5

func JoinNormalizedExpand3(
	path1, path2, path3 string,
) string

JoinNormalizedExpand3 normalized and expand applied auto

func JoinNormalizedExpandIf added in v0.2.5

func JoinNormalizedExpandIf(
	isExpandNormalize bool, path1, path2 string,
) string

JoinNormalizedExpandIf normalized and expand applied if condition meets

func JoinNormalizedIf added in v0.1.2

func JoinNormalizedIf(isNormalize bool, path1, path2 string) string

JoinNormalizedIf normalized applied auto

func JoinSimple

func JoinSimple(path1, path2 string) string

JoinSimple doesn't apply normalize

func JoinSimple3

func JoinSimple3(path1, path2, path3 string) string

JoinSimple3 Doesn't apply normalize

func JoinSimpleIf added in v0.3.6

func JoinSimpleIf(isUseLibraryFunc bool, path1, path2 string) string

JoinSimpleIf doesn't apply normalize

func JoinWithCurDir added in v0.3.9

func JoinWithCurDir(
	isNormalize,
	isLongPathFix,
	isExpandEnv bool,
	paths ...string,
) string

func JoinWithCurDirUsingCallStack added in v0.4.0

func JoinWithCurDirUsingCallStack(
	isNormalize,
	isLongPathFix,
	isExpandEnv bool,
	frameStackSkip int,
	paths ...string,
) string

func JoinWithSep

func JoinWithSep(
	isSkipEmpty,
	isExpandEnvVariables,
	isNormalizePlusLongPathFix bool,
	sep string,
	paths ...string,
) string

JoinWithSep isNormalizePlusLongPathFix if true then for windows add UNC Location fix

func JoinsNormalizedExpandIf added in v0.2.5

func JoinsNormalizedExpandIf(
	isExpandNormalize bool,
	baseDir string,
	relatives ...string,
) string

JoinsNormalizedExpandIf normalized and expand applied if condition meets

func JoinsNormalizedIf added in v0.2.5

func JoinsNormalizedIf(
	isNormalize bool,
	baseDir string,
	relatives ...string,
) string

JoinsNormalizedIf normalized and expand applied if condition meets

func TrimReplacePrefixRoot added in v0.4.3

func TrimReplacePrefixRoot(
	isNormalize,
	isLongPathForceFix bool,
	source,
	trimRootPrefix,
	rootReplacer string,
) string

func TrimReplacePrefixRootJoinSuffix added in v0.4.3

func TrimReplacePrefixRootJoinSuffix(
	isNormalize,
	isLongPathForceFix bool,
	source,
	trimRootPrefix,
	rootReplacer,
	suffixJoin string,
) string

func TrimReplacePrefixRoots added in v0.4.3

func TrimReplacePrefixRoots(
	isNormalize,
	isLongPathForceFix bool,
	baseLocations []string,
	trimRootPrefix,
	rootReplacer string,
) []string

func WithRoot added in v0.2.8

func WithRoot(paths ...string) string

func WithTemp added in v0.2.7

func WithTemp(
	locations ...string,
) string

WithTemp

LongPath JoinFix, EnvVarExpand, skip on empty path

Windows
    - "%temp%\locations\..."
Unix
    - "/tmp/locations/..."

func WithTempPlus added in v0.2.7

func WithTempPlus(
	isNormalizeLongPathFix,
	isExpandEnvVar bool,
	baseDir string,
	locations ...string,
) string

WithTempPlus

skip on empty path and others optional

Windows
    - "%temp%\locations\..."
Unix
    - "/tmp/locations/..."

func WithTempPlusDefaults added in v0.2.7

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

func WithTempTest added in v0.2.8

func WithTempTest(paths ...string) string

Types

type Joiner

type Joiner struct {
	// contains filtered or unexported fields
}

func EmptyJoiner

func EmptyJoiner() *Joiner

func NewJoiner

func NewJoiner(capacity int) *Joiner

func NewJoiner5

func NewJoiner5() *Joiner

func (*Joiner) Add

func (it *Joiner) Add(addingPath string) *Joiner

func (*Joiner) Adds

func (it *Joiner) Adds(addingPaths ...string) *Joiner

func (*Joiner) HasItems

func (it *Joiner) HasItems() bool

func (*Joiner) IsEmpty

func (it *Joiner) IsEmpty() bool

func (*Joiner) Length

func (it *Joiner) Length() int

func (*Joiner) OsSeparatorJoin added in v0.2.5

func (it *Joiner) OsSeparatorJoin(
	isExpandEnvVars,
	isNormalizePlusLongPathFix bool,
) string

OsSeparatorJoin

Usages osconsts.PathSeparator as separator

func (*Joiner) OsSeparatorJoinExpand added in v0.2.5

func (it *Joiner) OsSeparatorJoinExpand(
	isNormalizePlusLongPathFix bool,
) string

func (*Joiner) OsSeparatorJoinNormalized added in v0.2.5

func (it *Joiner) OsSeparatorJoinNormalized(
	isExpandEnvVars bool,
) string

func (*Joiner) String

func (it *Joiner) String() string

String normalize + expand and long path fix true

Usages osconsts.PathSeparator as separator

func (*Joiner) ToString

func (it *Joiner) ToString(
	isExpandEnvVars,
	isNormalizePlusLongPathFix bool,
	sep string,
) string

ToString isNormalizePlusLongPathFix if true then adds UNC path fix for Windows

Jump to

Keyboard shortcuts

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