Sha256: b3e5aa99424d9c8dc9c4a49e1e1f1dea5b4e7e5265c53f4025e7d8338f9a6927

Contents?: true

Size: 690 Bytes

Versions: 6

Compression:

Stored size: 690 Bytes

Contents

module RbGCCXML

  # Represents a <CvQualifiedType> node. This node keeps track of
  # the const nature of a Node.
  class CvQualifiedType < Type

    def ==(val)
      check_sub_type_without(val, /const/)
    end

    # See Node#to_cpp
    def to_cpp(qualified = true)
      type = NodeCache.find(attributes["type"])

      post_const = container ? " const" : ""
      pre_const = container ? "" : "const "

      "#{pre_const}#{type.to_cpp(qualified)}#{post_const}"
    end
    once :to_cpp

    # Have to redefine this as Type#const? looks up the 
    # tree for const, and in our case we are the const knower
    def const? #:nodoc:
      attributes["const"] == "1"
    end

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rbgccxml-1.1.0 lib/rbgccxml/nodes/types/cv_qualified_type.rb
rbgccxml-1.0.4 lib/rbgccxml/nodes/types/cv_qualified_type.rb
rbgccxml-1.0.3 lib/rbgccxml/nodes/types/cv_qualified_type.rb
rbgccxml-1.0.2 lib/rbgccxml/nodes/types/cv_qualified_type.rb
rbgccxml-1.0.1 lib/rbgccxml/nodes/types/cv_qualified_type.rb
rbgccxml-1.0 lib/rbgccxml/nodes/types/cv_qualified_type.rb