Documentation
¶
Index ¶
- Constants
- func BoolToString(value any) string
- func CheckSizeZero(size types.TSize) bool
- func ContainsStrings(strs []string, str string) bool
- func CopyFile(srcFilePath, dstFilePath string) error
- func Decode(r io.Reader) (image.Image, error)
- func DecodeAll(r io.Reader) ([]image.Image, error)
- func DecodeConfig(r io.Reader) (image.Config, error)
- func DetectImageFormatByte(imageData []byte) (string, error)
- func Encode(w io.Writer, im image.Image) error
- func Equal(s1 string, s2 ...string) bool
- func ExtractFile(zipFile *zip.File, outputPath, outputFilename string) (string, error)
- func ExtractOtherBuildArgs(buildArgs string) []string
- func FirstToUpper(s string) string
- func FixPropInfo(methods *ArrayMap[string, *TMethod], prop *lcl.ComponentProperties)
- func FloatToString(value any) string
- func ImageListAddPng(imageList lcl.IImageList, filePath string)
- func IntToString(value any) string
- func IsDir(path string) bool
- func IsExist(path string) bool
- func IsMainThread() bool
- func LoadImageList(owner lcl.IComponent, imageList []string, width, height int32) lcl.IImageList
- func MergeLdflags(defaultLdflags, customLdflags string) (mergedLdFlags []string)
- func MergeTags(defaultTags, customTags string) (mergedTags []string)
- func RemoveT(name string) string
- func RenderTemplate(templateText string, data any) ([]byte, error)
- func Replace(s, old, new string) string
- func Scale(data []byte, targetW, targetH int) []byte
- func SetToString(value any) string
- func Split(s, sep string) []string
- func StrToBool(s string) (bool, error)
- func StrToFloat32(s string) (float32, error)
- func StrToFloat64(s string) (float64, error)
- func StrToInt(s string) (int, error)
- func StrToInt8(s string) (int8, error)
- func StrToInt16(s string) (int16, error)
- func StrToInt32(s string) (int32, error)
- func StrToInt64(s string) (int64, error)
- func StrToUint(s string) (uint, error)
- func StrToUint8(s string) (uint8, error)
- func StrToUint16(s string) (uint16, error)
- func StrToUint32(s string) (uint32, error)
- func StrToUint64(s string) (uint64, error)
- func StrToUintptr(s string) (uintptr, error)
- func StringArrayReverse(array []string)
- func ValueToTargetType(value any, targetType reflect.Type) (any, error)
- func ZipFolder(srcDir string, destZip string, skip *HashSet[string]) error
- type Array
- type ArrayMap
- func (m *ArrayMap[K, T]) Add(key K, value T)
- func (m *ArrayMap[K, T]) ContainsKey(key K) bool
- func (m *ArrayMap[K, T]) ContainsValue(value T) bool
- func (m *ArrayMap[K, T]) Del(key K)
- func (m *ArrayMap[K, T]) Get(key K) T
- func (m *ArrayMap[K, T]) Iterate(fn func(key K, value T) bool)
- func (m *ArrayMap[K, T]) Keys() []K
- func (m *ArrayMap[K, T]) Values() (result []T)
- type ArraySet
- type Buffer
- type HashMap
- func (m *HashMap[K, T]) Add(key K, value T)
- func (m *HashMap[K, T]) Clear()
- func (m *HashMap[K, T]) ContainsKey(key K) bool
- func (m *HashMap[K, T]) ContainsValue(value T) (key K, ok bool)
- func (m *HashMap[K, T]) Get(key K) T
- func (m *HashMap[K, T]) Iterate(fn func(key K, value T) bool)
- func (m *HashMap[K, T]) Remove(name K)
- func (m *HashMap[K, T]) Values() map[K]T
- type HashSet
- type ImageList
- type ImageRect
- type Null
- type TMethod
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func CheckSizeZero ¶
func ContainsStrings ¶
func DetectImageFormatByte ¶
DetectImageFormatByte 检测图片真实格式
func ExtractFile ¶
ExtractFile 从zip文件中提取指定文件到目标路径
zipFile: 要提取的zip文件对象 targetFile: 目标文件路径 error: 提取过程中发生的错误,如果成功则返回nil
func ExtractOtherBuildArgs ¶
ExtractOtherBuildArgs 从构建参数字符串中提取其他构建参数 该函数会移除 -tags 和 -ldflags 相关的参数,并清理格式
buildArgs: 原始的构建参数字符串,可能包含各种 go build 选项
string: 清理后的构建参数字符串,移除了 -tags 和 -ldflags 参数,
所有单引号已转换为双引号,多余空格已被清理
func FixPropInfo ¶
func FixPropInfo(methods *ArrayMap[string, *TMethod], prop *lcl.ComponentProperties)
FixPropInfo 修复属性信息,将属性名与对象方法名进行匹配和修正 @param methods 对象方法列表,用于查找和匹配属性对应的方法 @param prop 组件属性信息,需要被修正的属性对象
func LoadImageList ¶
func LoadImageList(owner lcl.IComponent, imageList []string, width, height int32) lcl.IImageList
加载图片列表
func MergeLdflags ¶
MergeLdflags 合并默认和自定义的链接器标志(ldflags) 该函数将两个 ldflags 字符串按空格分割后合并,自动去除重复项 并保持原有的插入顺序
defaultLdflags: 默认的链接器标志字符串,多个标志间以空格分隔
customLdflags: 自定义的链接器标志字符串,多个标志间以空格分隔
mergedLdFlags: 合并后的链接器标志字符串切片,已去重且保持原有顺序,
优先保留 defaultLdflags 中的标志,然后追加 customLdflags 中独有的标志
func MergeTags ¶
MergeTags 合并默认和自定义的构建标签(tags) 该函数将两个 tags 字符串按逗号或空格分割后合并,自动去除重复项 并保持原有的插入顺序
defaultTags: 默认的构建标签字符串,多个标签间以逗号或空格分隔
customTags: 自定义的构建标签字符串,多个标签间以逗号或空格分隔
mergedTags: 合并后的构建标签字符串切片,已去重且保持原有顺序,
优先保留 defaultTags 中的标签,然后追加 customTags 中独有的标签
func Scale ¶
Scale 将PNG格式的图片数据缩放到指定尺寸
data: 原始PNG图片的字节数据 targetW: 目标宽度 targetH: 目标高度 []byte: 缩放后的PNG图片字节数据,如果处理失败则返回nil
func SetToString ¶
SetToString 集合转字符串 [Xxx,Xxx,Xxx] > Xxx,Xxx,Xxx
func StrToFloat32 ¶
StrToFloat32 字符串转 float32(范围:±3.4e38,精度约 6-7 位小数)
func StrToFloat64 ¶
StrToFloat64 字符串转 float64(范围:±1.8e308,精度约 15-17 位小数)
func StrToInt32 ¶
StrToInt32 字符串转 int32(范围:-2147483648 ~ 2147483647)
func StrToInt64 ¶
StrToInt64 字符串转 int64(范围:-9223372036854775808 ~ 9223372036854775807)
func StrToUint32 ¶
StrToUint32 字符串转 uint32(范围:0 ~ 4294967295)
func StrToUint64 ¶
StrToUint64 字符串转 uint64(范围:0 ~ 18446744073709551615)
func ValueToTargetType ¶
ValueToTargetType 基本类型转换函数, 将值转换为目标类型
Types ¶
type Array ¶
type Array[T comparable] struct { // contains filtered or unexported fields }
func NewArray ¶
func NewArray[T comparable]() *Array[T]
type ArrayMap ¶
type ArrayMap[K, T comparable] struct { // contains filtered or unexported fields }
func GetObjectMethodNames ¶
GetObjectMethodNames 获取指定对象的所有方法名称 该函数通过反射机制遍历对象类型及其嵌套类型的所有方法,并返回一个包含所有方法名称的ArrayMap 参数:
v: 任意类型的对象实例,用于获取其方法信息
返回值:
*ArrayMap[string]: 包含所有方法名称的ArrayMap指针,如果输入为nil或无法获取类型信息则返回nil
func NewArrayMap ¶
func NewArrayMap[K, T comparable]() *ArrayMap[K, T]
func (*ArrayMap[K, T]) ContainsKey ¶
func (*ArrayMap[K, T]) ContainsValue ¶
type ArraySet ¶
type ArraySet struct {
// contains filtered or unexported fields
}
func NewArraySet ¶
func NewArraySet() *ArraySet
func (*ArraySet) ContainsKey ¶
type Buffer ¶
func (*Buffer) WriteString ¶
type HashMap ¶
type HashMap[K, T comparable] struct { // contains filtered or unexported fields }
func NewHashMap ¶
func NewHashMap[K, T comparable]() *HashMap[K, T]
func (*HashMap[K, T]) ContainsKey ¶
func (*HashMap[K, T]) ContainsValue ¶
type HashSet ¶
type HashSet[T comparable] struct { // contains filtered or unexported fields }
func NewHashSet ¶
func NewHashSet[T comparable]() *HashSet[T]
func NewHashSetByValues ¶
func NewHashSetByValues[T comparable](values ...T) *HashSet[T]
type ImageList ¶
type ImageList struct {
// contains filtered or unexported fields
}
func NewImageList ¶
func NewImageList(owner lcl.IComponent, dirName string, rect ImageRect) *ImageList
func (*ImageList) ImageIndex ¶
func (*ImageList) ImageList100 ¶
func (m *ImageList) ImageList100() lcl.IImageList
func (*ImageList) ImageList150 ¶
func (m *ImageList) ImageList150() lcl.IImageList
func (*ImageList) ImageList200 ¶
func (m *ImageList) ImageList200() lcl.IImageList