當前位置: 首頁>>代碼示例>>Golang>>正文


Golang Named.CName方法代碼示例

本文整理匯總了Golang中github.com/hailiang/go-gccxml.Named.CName方法的典型用法代碼示例。如果您正苦於以下問題:Golang Named.CName方法的具體用法?Golang Named.CName怎麽用?Golang Named.CName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/hailiang/go-gccxml.Named的用法示例。


在下文中一共展示了Named.CName方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: newExported

func newExported(t gcc.Named) baseCNamer {
	return baseCNamer{
		id:    t.Id(),
		cName: t.CName(),
		file:  t.File(),
	}
}
開發者ID:h12w,項目名稱:cwrap,代碼行數:7,代碼來源:parse.go

示例2: lowerName

// lower camel name
func (pac *Package) lowerName(o gcc.Named) string {
	s := snakeToLowerCamel(o.CName())
	switch s {
	case "type", "len":
		s += "_"
	}
	return s
}
開發者ID:sbinet,項目名稱:cwrap,代碼行數:9,代碼來源:package.go

示例3: newPtrTypedef

func (pac *Package) newPtrTypedef(t gcc.Named) Ptr {
	goName := pac.globalName(t)
	if goName == "" {
		goName = "uintptr"
	}
	return Ptr{namer{
		goName:  goName,
		cgoName: "C." + t.CName(),
	}}
}
開發者ID:sbinet,項目名稱:cwrap,代碼行數:10,代碼來源:parse.go

示例4: globalName

// type name that may be declared in this or included packages.
func (pac *Package) globalName(o gcc.Named) string {
	if pac.fileIds.Has(o.File()) && pac.hasPrefix(o.CName()) {
		return pac.localName(o)
	}
	for _, inc := range pac.Included {
		if goName := inc.globalName(o); goName != "" && !contains(goName, ".") {
			return joins(inc.PacName, ".", goName)
		}
	}
	return ""
}
開發者ID:sbinet,項目名稱:cwrap,代碼行數:12,代碼來源:package.go

示例5: lowerName

// lower camel name
func lowerName(o gcc.Named) string {
	s := snakeToLowerCamel(o.CName())
	switch s {
	case "func", "interface", "select", "defer", "go", "map",
		"chan", "package", "fallthrough", "range", "type", "import", "var",
		"true", "false", "iota", "nil",
		"append", "cap", "close", "complex", "copy", "delete", "imag", "len",
		"make", "new", "panic", "print", "println", "real", "recover":
		s += "_"
	}
	return s
}
開發者ID:h12w,項目名稱:cwrap,代碼行數:13,代碼來源:parse.go

示例6: newPtrReference

func (pac *Package) newPtrReference(t gcc.Named) Ptr {
	goName := pac.globalName(t)
	if goName == "" {
		goName = "uintptr"
	} else {
		goName = "*" + goName
	}
	return Ptr{namer{
		goName:  goName,
		cgoName: "*C." + t.CName(),
	}}
}
開發者ID:sbinet,項目名稱:cwrap,代碼行數:12,代碼來源:parse.go

示例7: upperName

// upper camel name
func (pac *Package) upperName(o gcc.Named) string {
	return upperName(o.CName(), pac.From.NamePrefix)
}
開發者ID:sbinet,項目名稱:cwrap,代碼行數:4,代碼來源:package.go


注:本文中的github.com/hailiang/go-gccxml.Named.CName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。