common

package
v2.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package common CEF Util

Index

Constants

View Source
const (
	IntSize   = strconv.IntSize //bit
	IntSize32 = 32              //

)

Variables

View Source
var DisableCache bool

DisableCache will disable caching of the home directory. Caching is enabled by default.

Functions

func ArrayIndexOf

func ArrayIndexOf(array interface{}, a interface{}) int

ArrayIndexOf 返回a在array数组的下标, a必须和array元素的类型相同

func BoolToByte

func BoolToByte(b bool) byte

func ByteToBool

func ByteToBool(b byte) bool

func ByteToInt8

func ByteToInt8(b byte) int8

func ByteToUInt8

func ByteToUInt8(b byte) uint8

func BytesToFloat32

func BytesToFloat32(bytes []byte) float32

BytesToFloat32 byte转Float64

func BytesToFloat64

func BytesToFloat64(bytes []byte) float64

BytesToFloat64 byte转Float64

func BytesToInt

func BytesToInt(b []byte) int

func BytesToInt16

func BytesToInt16(b []byte) int16

func BytesToInt32

func BytesToInt32(b []byte) int32

func BytesToInt64

func BytesToInt64(b []byte) int64

func BytesToString

func BytesToString(data []byte) string

func BytesToUInt

func BytesToUInt(b []byte) uint

func BytesToUInt16

func BytesToUInt16(b []byte) uint16

func BytesToUInt32

func BytesToUInt32(b []byte) uint32

func BytesToUInt64

func BytesToUInt64(b []byte) uint64

func Concat

func Concat(str ...string) string

Concat 字符串拼接

func DDateTimeToGoDateTime

func DDateTimeToGoDateTime(dateTime float64) time.Time

func Dir

func Dir() (string, error)

Dir returns the home directory for the executing user.

This uses an OS-specific method for discovering the home directory. An error is returned if a home directory cannot be detected.

func Expand

func Expand(path string) (string, error)

Expand expands the path to include the home directory if the path is prefixed with `~`. If it isn't prefixed with `~`, the path is returned as-is.

func Float32ToBytes

func Float32ToBytes(float float32) []byte

Float32ToBytes Float64转byte

func Float64ToBytes

func Float64ToBytes(float float64) []byte

Float64ToBytes Float64转byte

func FrameworkDir added in v2.3.0

func FrameworkDir() string

FrameworkDir

返回CEF框架目录, 以当前执行文件所在目录开始查找
如果当前执行文件目录未找到,再从ENERGY_HOME环境变量查找
Darwin 平台除外

func GetInstancePtr

func GetInstancePtr(ptr uintptr) unsafe.Pointer

GetInstancePtr 获取指针的指针的地址

func GetParamOf

func GetParamOf(index int, ptr uintptr) uintptr

GetParamOf 获取参数指针

func GetParamPtr

func GetParamPtr(ptr uintptr, offset int) unsafe.Pointer

GetParamPtr 根据指定指针位置开始 偏移获取指针

func GoDateTimeToDDateTime

func GoDateTimeToDDateTime(dateTime time.Time) float64

func GoStr

func GoStr(ptr uintptr) string

func GoroutineID

func GoroutineID() (id uint64)

GoroutineID 获取当前携程ID

func Int16ToBytes

func Int16ToBytes(i int16) []byte

func Int32ToBytes

func Int32ToBytes(i int32) []byte

func Int64ToBytes

func Int64ToBytes(i int64) []byte

func Int8ToBytes

func Int8ToBytes(i int8) []byte

func IntToBytes

func IntToBytes(i int) []byte

func InterfaceToString

func InterfaceToString(value interface{}) string

InterfaceToString 接口转 string

func IsDarwin

func IsDarwin() bool

func IsLinux

func IsLinux() bool

func IsPlan9

func IsPlan9() bool

func IsWindows

func IsWindows() bool

func Reset

func Reset()

Reset clears the cache, forcing the next call to Dir to re-detect the home directory. This generally never has to be called, but can be useful in tests if you're modifying the home directory via the HOME env var or something.

func SetFrameworkEnv added in v2.3.0

func SetFrameworkEnv(value string)

func StrToFloat32

func StrToFloat32(value string) float32

func StrToFloat64

func StrToFloat64(value string) float64

func StrToInt32

func StrToInt32(value string) int32

func StrToInt64

func StrToInt64(value string) int64

func StringToBytes

func StringToBytes(s string, isDStr ...bool) []byte

String转换Bytes数组,isDStr转换DString 默认GoString

func UInt16ToBytes

func UInt16ToBytes(i uint16) []byte

func UInt32ToBytes

func UInt32ToBytes(i uint32) []byte

func UInt64ToBytes

func UInt64ToBytes(i uint64) []byte

func UInt8ToBytes

func UInt8ToBytes(i uint8) []byte

func UIntToBytes

func UIntToBytes(i uint) []byte

func ValueToBool

func ValueToBool(v interface{}) bool

ValueToBool bool

func ValueToFloat64

func ValueToFloat64(v interface{}) float64

func ValueToInt

func ValueToInt(v interface{}) int

Types

This section is empty.

Directories

Path Synopsis
Package imports Dynamic Library Import Based on LCL You can also import and add custom dynamic libraries here
Package imports Dynamic Library Import Based on LCL You can also import and add custom dynamic libraries here

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL