v.io: v.io/x/ref/lib/glob Index | Files

package glob

import "v.io/x/ref/lib/glob"

Package glob defines a globbing syntax and implements matching routines.

Globs match a slash separated series of glob expressions.

// Patterns:
term ['/' term]*
term:
'*'         matches any sequence of non-Separator characters
'?'         matches any single non-Separator character
'[' [ '^' ] { character-range } ']'
// Character classes (must be non-empty):
c           matches character c (c != '*', '?', '\\', '[', '/')
'\\' c      matches character c
// Character-ranges:
c           matches character c (c != '\\', '-', ']')
'\\' c      matches character c
lo '-' hi   matches character c for lo <= c <= hi

This package is DEPRECATED. Use v.io/v23/glob instead.

Index

Package Files

glob.go

type Glob Uses

type Glob struct {
    *glob.Glob
}

Glob represents a slash separated path glob pattern. Deprecated: use v.io/v23/glob.Glob instead.

func Parse Uses

func Parse(pattern string) (*Glob, error)

Parse returns a new Glob. Deprecated: use v.io/v23/glob.Parse instead.

func (*Glob) Finished Uses

func (g *Glob) Finished() bool

Finished returns true if the pattern cannot match anything. Deprecated: use v.io/v23/glob.Finished instead.

func (*Glob) MatchInitialSegment Uses

func (g *Glob) MatchInitialSegment(segment string) (matched bool, exact bool, remainder *Glob)

MatchInitialSegment tries to match segment against the initial element of g. Returns: matched, a boolean indicating whether the match was successful; exact, a boolean indicating whether segment matched a fixed string pattern; remainder, a Glob representing the unmatched remainder of g. Deprecated: use v.io/v23/glob.MatchInitialSegment instead.

func (*Glob) PartialMatch Uses

func (g *Glob) PartialMatch(start int, elems []string) (matched bool, exact bool, remainder *Glob)

PartialMatch tries matching elems against part of a glob pattern. Returns: matched, a boolean indicating whether each element e_i of elems matches the (start + i)th element of the glob pattern; exact, a boolean indicating whether elems matched a fixed string pattern. <path> is considered an exact match for pattern <path>/...; remainder, a Glob representing the unmatched remainder of g. remainder will be empty if the pattern is completely matched.

Note that if the glob is recursive elems can have more elements then the glob pattern and still get a true result. Deprecated: use v.io/v23/glob.PartialMatch instead.

func (*Glob) Split Uses

func (g *Glob) Split(start int) *Glob

Split returns the suffix of g starting at the path element corresponding to start. Deprecated: use v.io/v23/glob.Split instead.

func (*Glob) SplitFixedElements Uses

func (g *Glob) SplitFixedElements() ([]string, *Glob)

SplitFixedElements returns the part of the glob pattern that contains only fixed elements, and the glob that follows it. Deprecated: use v.io/v23/glob.SplitFixedElements instead.

func (*Glob) SplitFixedPrefix Uses

func (g *Glob) SplitFixedPrefix() ([]string, *Glob)

SplitFixedPrefix returns the part of the glob pattern that contains only fixed elements, and the glob that follows it. Deprecated: use v.io/v23/glob.SplitFixedPrefix instead.

func (*Glob) Tail Uses

func (g *Glob) Tail() *Glob

Tail returns the suffix of g starting at the second element. Deprecated: use v.io/v23/glob.Tail instead.

Package glob imports 1 packages (graph). Updated 2020-10-22. Refresh now. Tools for package owners.