mirror of
https://gitee.com/energye/energy.git
synced 2024-12-16 02:11:35 +08:00
39 lines
693 B
Go
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 ""
|
|
}
|