mirror of
https://github.com/dolthub/dolt.git
synced 2026-04-29 11:31:28 -05:00
a560139d73
This will enable us to walk the chunk graph without having to go through weird contortions to figure out which values don't have chunks in any chunkstore (because they were inlined). Towards issue #82
43 lines
597 B
Go
43 lines
597 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) Blob() Blob {
|
|
return NewBlob([]byte(fs.s))
|
|
}
|
|
|
|
func (fs String) String() string {
|
|
return fs.s
|
|
}
|
|
|
|
func (fs String) Ref() ref.Ref {
|
|
return ensureRef(fs.ref, fs)
|
|
}
|
|
|
|
func (fs String) Equals(other Value) bool {
|
|
if other == nil {
|
|
return false
|
|
} else {
|
|
return fs.Ref() == other.Ref()
|
|
}
|
|
}
|
|
|
|
func (fs String) Futures() []Future {
|
|
return nil
|
|
}
|
|
|
|
func StringFromVal(v Value) String {
|
|
return v.(String)
|
|
}
|