Files
dolt/types/string.go
Aaron Boodman 69a86f3036 Rewrite walk() to walk value tree instead of chunks
Also fix quad_tree to take advantage of that to be generic again.

Fixes #445, #497
2015-11-05 16:12:02 -08:00

42 lines
645 B
Go

package types
import "github.com/attic-labs/noms/ref"
type String struct {
s string
ref *ref.Ref
}
func NewString(s string) String {
return String{s, &ref.Ref{}}
}
func (fs String) String() string {
return fs.s
}
func (fs String) Ref() ref.Ref {
return EnsureRef(fs.ref, fs)
}
func (s String) Equals(other Value) bool {
if other, ok := other.(String); ok {
return s.s == other.s
}
return false
}
func (fs String) Chunks() []ref.Ref {
return nil
}
func (fs String) ChildValues() []Value {
return nil
}
var typeRefForString = MakePrimitiveTypeRef(StringKind)
func (fs String) TypeRef() TypeRef {
return typeRefForString
}