mirror of
https://github.com/KLayout/klayout.git
synced 2026-08-29 17:30:09 +02:00
Merge branch 'qt6'
This commit is contained in:
@@ -87,8 +87,8 @@ end
|
||||
# "cv" is a CPPCV object.
|
||||
class CPPFunc < CPPOuterType
|
||||
|
||||
attr_accessor :inner, :args, :cv
|
||||
def_initializer :inner, :args, :cv
|
||||
attr_accessor :inner, :args, :cv, :ref
|
||||
def_initializer :inner, :args, :cv, :ref
|
||||
|
||||
def to_s
|
||||
a = self.args
|
||||
@@ -96,12 +96,13 @@ class CPPFunc < CPPOuterType
|
||||
if !a.is_a?(Array)
|
||||
a = [a]
|
||||
end
|
||||
self.inner.to_s + " (" + a.join(", ") + ")" + (self.cv ? " " + self.cv.to_s : "")
|
||||
self.inner.to_s + " (" + a.join(", ") + ")" + (self.cv ? " " + self.cv.to_s : "") + (self.ref ? " " + self.ref.to_s : "")
|
||||
end
|
||||
|
||||
def dump(i)
|
||||
i + "CPPFunc\n" + i + " inner:\n" + self.inner.dump(i + " ") + "\n" +
|
||||
i + " cv: " + self.cv.to_s + "\n" +
|
||||
i + " ref: " + self.ref.to_s + "\n" +
|
||||
i + " args:\n" + (self.args || []).collect { |f| f.dump(i + " ") }.join("\n")
|
||||
end
|
||||
|
||||
@@ -469,29 +470,19 @@ class CPPFriendDecl < CPPObject
|
||||
end
|
||||
|
||||
# @brief A type template argument (with an optional initializer)
|
||||
# @attribute id The name of the argument (a string)
|
||||
# @attribute type The template argument (a type)
|
||||
# @attribute def_type The default type (nil or a CPPType object)
|
||||
class CPPClassTemplateArg < CPPObject
|
||||
|
||||
attr_accessor :id, :def_type
|
||||
def_initializer :id, :def_type
|
||||
attr_accessor :type, :def_type
|
||||
def_initializer :type, :def_type
|
||||
|
||||
def to_s
|
||||
self.id + (self.def_type ? ("=" + self.def_type.to_s) : "")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# @brief A value template argument (with an optional initializer)
|
||||
# @attribute type A CPPType object describing the type
|
||||
# @attribute def_expr The initializer expression (a string) or nil if no initializer is given
|
||||
class CPPDirectTemplateArg < CPPObject
|
||||
|
||||
attr_accessor :type, :def_expr
|
||||
def_initializer :type, :def_expr
|
||||
|
||||
def to_s
|
||||
self.type.to_s + (self.def_expr ? ("=" + self.def_expr.to_s) : "")
|
||||
if self.def_type
|
||||
self.type.to_s + "=" + self.def_type.to_s
|
||||
else
|
||||
self.type.to_s
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -624,15 +615,15 @@ end
|
||||
# @attribute specs the enum members (an array of CPPEnumSpec objects)
|
||||
class CPPEnum < CPPObject
|
||||
|
||||
attr_accessor :name, :specs
|
||||
def_initializer :name, :specs
|
||||
attr_accessor :name, :specs, :is_class
|
||||
def_initializer :name, :specs, :is_class
|
||||
|
||||
def to_s
|
||||
"enum " + (self.name || "")
|
||||
end
|
||||
|
||||
def dump(i)
|
||||
l = i + self.to_s + " {\n"
|
||||
l = i + self.to_s + (self.is_class ? " class" : "") + " {\n"
|
||||
l += (self.specs || []).collect { |s| i + " " + s.to_s + "\n" }.join("")
|
||||
l += i + "}"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user