filepathlite

Imports

Imports #

"internal/bytealg"
"internal/stringslite"
"syscall"
"errors"
"internal/stringslite"
"io/fs"
"slices"
"internal/bytealg"
"internal/stringslite"
"internal/bytealg"
"internal/stringslite"

Constants & Variables

ListSeparator const #

const ListSeparator = ';'

ListSeparator const #

const ListSeparator = '\000'

ListSeparator const #

const ListSeparator = ':'

Separator const #

const Separator = '\\'

Separator const #

const Separator = '/'

Separator const #

const Separator = '/'

errInvalidPath var #

var errInvalidPath = *ast.CallExpr

Structs

lazybuf struct #

A lazybuf is a lazily constructed path buffer. It supports append, reading previously appended bytes, and retrieving the final string. It does not allocate a buffer to hold the output until that output diverges from s.

type lazybuf struct {
path string
buf []byte
w int
volAndPath string
volLen int
}

Functions

Base function #

Base is filepath.Base.

func Base(path string) string

Clean function #

Clean is filepath.Clean.

func Clean(path string) string

Dir function #

Dir is filepath.Dir.

func Dir(path string) string

Ext function #

Ext is filepath.Ext.

func Ext(path string) string

FromSlash function #

FromSlash is filepath.ToSlash.

func FromSlash(path string) string

IsAbs function #

IsAbs reports whether the path is absolute.

func IsAbs(path string) bool

IsAbs function #

IsAbs reports whether the path is absolute.

func IsAbs(path string) (b bool)

IsAbs function #

IsAbs reports whether the path is absolute.

func IsAbs(path string) bool

IsLocal function #

IsLocal is filepath.IsLocal.

func IsLocal(path string) bool

IsPathSeparator function #

func IsPathSeparator(c uint8) bool

IsPathSeparator function #

func IsPathSeparator(c uint8) bool

IsPathSeparator function #

func IsPathSeparator(c uint8) bool

Localize function #

Localize is filepath.Localize.

func Localize(path string) (string, error)

Split function #

Split is filepath.Split.

func Split(path string) (dir string, file string)

ToSlash function #

ToSlash is filepath.ToSlash.

func ToSlash(path string) string

VolumeName function #

VolumeName is filepath.VolumeName.

func VolumeName(path string) string

VolumeNameLen function #

VolumeNameLen returns the length of the leading volume name on Windows. It returns 0 elsewhere.

func VolumeNameLen(path string) int

append method #

func (b *lazybuf) append(c byte)

cutPath function #

cutPath slices path around the first path separator.

func cutPath(path string) (before string, after string, found bool)

equalFold function #

func equalFold(a string, b string) bool

index method #

func (b *lazybuf) index(i int) byte

isLocal function #

func isLocal(path string) bool

isLocal function #

func isLocal(path string) bool

isLocal function #

func isLocal(path string) bool

isReservedBaseName function #

func isReservedBaseName(name string) bool

isReservedName function #

isReservedName reports if name is a Windows reserved device name. It does not detect names with an extension, which are also reserved on some Windows versions. For details, search for PRN in https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file.

func isReservedName(name string) bool

isUNC function #

isUNC reports whether path is a UNC path.

func isUNC(path string) bool

localize function #

func localize(path string) (string, error)

localize function #

func localize(path string) (string, error)

localize function #

func localize(path string) (string, error)

pathHasPrefixFold function #

pathHasPrefixFold tests whether the path s begins with prefix, ignoring case and treating all path separators as equivalent. If s is longer than prefix, then s[len(prefix)] must be a path separator.

func pathHasPrefixFold(s string, prefix string) bool

postClean function #

postClean adjusts the results of Clean to avoid turning a relative path into an absolute or rooted one.

func postClean(out *lazybuf)

postClean function #

func postClean(out *lazybuf)

prepend method #

func (b *lazybuf) prepend(prefix ...byte)

replaceStringByte function #

func replaceStringByte(s string, old byte, new byte) string

string method #

func (b *lazybuf) string() string

toUpper function #

func toUpper(c byte) byte

uncLen function #

uncLen returns the length of the volume prefix of a UNC path. prefixLen is the prefix prior to the start of the UNC host; for example, for "//host/share", the prefixLen is len("//")==2.

func uncLen(path string, prefixLen int) int

unixIsLocal function #

func unixIsLocal(path string) bool

volumeNameLen function #

volumeNameLen returns length of the leading volume name on Windows. It returns 0 elsewhere.

func volumeNameLen(path string) int

volumeNameLen function #

volumeNameLen returns length of the leading volume name on Windows. It returns 0 elsewhere. See: https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats https://googleprojectzero.blogspot.com/2016/02/the-definitive-guide-on-win32-to-nt.html

func volumeNameLen(path string) int

volumeNameLen function #

volumeNameLen returns length of the leading volume name on Windows. It returns 0 elsewhere.

func volumeNameLen(path string) int

Generated with Arrow