Documentation ¶
Index ¶
- func Clean(path string) string
- func Join(elems ...string) string
- type Builder
- func (b Builder) Absolute() bool
- func (b *Builder) Append(path string)
- func (b *Builder) AppendBytes(path []byte)
- func (b Builder) Bytes() []byte
- func (b Builder) Cap() int
- func (b *Builder) Clean(path string) string
- func (b *Builder) Guarantee(size int)
- func (b *Builder) Join(elems ...string) string
- func (b Builder) Len() int
- func (b *Builder) Reset()
- func (b *Builder) SetAbsolute(enabled bool)
- func (b Builder) String() string
- func (b *Builder) Truncate(size int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Builder ¶
type Builder struct { // B is the underlying byte buffer B []byte // contains filtered or unexported fields }
Builder provides a means of cleaning and joining system paths, while retaining a singular underlying byte buffer for performance.
func (*Builder) Append ¶
Append adds and cleans the supplied path string to the builder's internal buffer, growing the buffer if necessary to accomodate the extra path length.
func (*Builder) AppendBytes ¶
AppendBytes adds and cleans the supplied path bytes to the builder's internal buffer, growing the buffer if necessary to accomodate the extra path length.
func (*Builder) Clean ¶
Clean creates the shortest possible functional equivalent to the supplied path, resetting the builder before performing this operation. The builder object is NOT reset after return.
func (*Builder) Guarantee ¶
Guarantee ensures there is at least the requested size free bytes available in the buffer, reallocating if necessary
func (*Builder) Join ¶
Join connects and cleans multiple paths, resetting the builder before performing this operation and returning the shortest possible combination of all the supplied paths. The builder object is NOT reset after return.
func (*Builder) SetAbsolute ¶
SetAbsolute converts the current path to-or-from absolute.