Sha256: 3d01a4b9a98a1e656433c7ec6a071c04ba614a32e063af9ef2e76d2cb37eb51d

Contents?: true

Size: 1.71 KB

Versions: 1

Compression:

Stored size: 1.71 KB

Contents

module RbGCCXML
  class Node

    # Specify to Rb++ that this node is not to be wrapped
    def ignore
      cache[:ignored] = true
    end

    # Un-ignore this node, useful if there's a glob ignore and the wrapper
    # just wants a few of the classes
    def unignore
      cache[:ignored] = false
    end

    # Has this node been previously declared to not be wrapped?
    def ignored?
      !!cache[:ignored]
    end

    # Specifies that this node has been included somewhere else
    def moved_to=(val)
      cache[:moved_to] = val
    end

    # Change what the name of this node will be when wrapped into Ruby
    def wrap_as(name)
      cache[:wrap_as] = name
      self
    end

    # Where has this node moved to?
    def moved_to
      cache[:moved_to]
    end

    # Has this node been renamed
    def renamed?
      !!cache[:wrap_as]
    end

    alias_method :rbgccxml_name, :name
    def name #:nodoc:
      cache[:wrap_as] || rbgccxml_name
    end

    def cpp_name
      rbgccxml_name
    end

    # In some cases, the automatic typedef lookup of rb++ can end up
    # doing the wrong thing (for example, it can take a normal class
    # and end up using the typedef for stl::container<>::value_type).
    # Flag a given class as ignoring this typedef lookup if this
    # situation happens.
    def disable_typedef_lookup
      cache[:disable_typedef_lookup] = true
    end

    def _disable_typedef_lookup? #:nodoc:
      !!cache[:disable_typedef_lookup]
    end

    # Is this node an incomplete node?
    # TODO Move to rbgccxml
    def incomplete?
      self["incomplete"] ? self["incomplete"] == "1" : false
    end

    protected

    # Get this node's settings cache
    def cache
      NodeCache.get(self)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rbplusplus-0.9.1 lib/rbplusplus/transformers/node.rb