energy/cef/cef-v8-js-string.go
2022-10-04 22:34:57 +08:00

39 lines
693 B
Go

//----------------------------------------
//
// Copyright © yanghy. All Rights Reserved.
//
// Licensed under GNU General Public License v3.0
//
//----------------------------------------
package cef
import "github.com/energye/energy/consts"
type JSString struct {
ICEFv8Value
}
func (m *JSString) AsString() (*JSString, error) {
return m, nil
}
func (m *JSString) Value() string {
if val, err := m.StringValue(); err == nil {
return val
} else {
return ""
}
}
func (m *JSString) SetValue(value string) {
m.valueType = consts.V8_VALUE_STRING
m.value = value
}
func (m *JSString) ToString() string {
if val, err := m.StringValue(); err == nil {
return val
}
return ""
}