glob

package
v0.0.0-...-ba1c585 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2017 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Glob

type Glob struct {
	*glob.Glob
}

Glob represents a slash separated path glob pattern. This type is DEPRECATED. Use v.io/v23/glob.Glob instead.

func Parse

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

Parse returns a new Glob. This function is DEPRECATED.

func (*Glob) Finished

func (g *Glob) Finished() bool

Finished returns true if the pattern cannot match anything. This method is DEPRECATED.

func (*Glob) MatchInitialSegment

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. This method is DEPRECATED.

func (*Glob) PartialMatch

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. This method is DEPRECATED.

func (*Glob) Split

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

Split returns the suffix of g starting at the path element corresponding to start. This method is DEPRECATED.

func (*Glob) SplitFixedElements

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. This method is DEPRECATED.

func (*Glob) SplitFixedPrefix

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. This method is DEPRECATED.

func (*Glob) Tail

func (g *Glob) Tail() *Glob

Tail returns the suffix of g starting at the second element. This method is DEPRECATED.

Jump to

Keyboard shortcuts

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