-
Notifications
You must be signed in to change notification settings - Fork 21
/
string.go
48 lines (33 loc) · 1.09 KB
/
string.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package cwl
import (
"fmt"
//"github.com/mitchellh/mapstructure"
)
//type String struct {
// CWLType_Impl `yaml:",inline" json:",inline" bson:",inline" mapstructure:",squash"`
// //Class CWLType_Type `yaml:"class,omitempty" json:"class,omitempty" bson:"class,omitempty"`
// Value string `yaml:"value,omitempty" json:"value,omitempty" bson:"value,omitempty"`
//}
type String string
func (s *String) Is_CWL_object() {}
func (s *String) GetClass() string { return string(CWL_string) } // for CWL_object
func (s *String) GetType() CWLType_Type { return CWL_string }
func (s *String) String() string { return string(*s) }
func (s *String) GetId() string { return "" }
func (s *String) SetId(i string) {}
func (s *String) Is_CWL_minimal() {}
func NewString(value string) (s *String) {
var s_nptr String
s_nptr = String(value)
s = &s_nptr
return
}
func NewStringFromInterface(native interface{}) (s *String, err error) {
real_string, ok := native.(string)
if !ok {
err = fmt.Errorf("(NewStringFromInterface) Cannot create string")
return
}
s = NewString(real_string)
return
}