class Objc2swiftAssistant::ObjCDirectoryNode

Attributes

associated_generated_directory[RW]

Public Class Methods

new(path, file_set) click to toggle source
Calls superclass method Objc2swiftAssistant::DirectoryNode::new
# File lib/objc2swift_assistant/file_sets.rb, line 163
def initialize(path, file_set)
  super(path, file_set)
end

Public Instance Methods

create_associated_generated_nodes( generated_file_set ) click to toggle source
# File lib/objc2swift_assistant/file_sets.rb, line 198
def create_associated_generated_nodes( generated_file_set )
  # puts( "generaating file node: #{@relative_path}")
  #TODO: Break this out into Swift generation-specific ruby file
  return if @pruned

#   #TODO: allow mapping to new directory scruture for this file
  generated_relative_path = generated_file_set.root + @relative_path
  @associated_generated_directory = generated_file_set.directory_node_for_path( generated_relative_path )
  @file_nodes_by_name.each_value do |file_node|
    # puts( "generaating file node: #{file_node.}")
    file_node.create_generated_file_nodes( generated_file_set, @associated_generated_directory )
  end
end
file_node_for_file( without_extension_string ) click to toggle source
# File lib/objc2swift_assistant/file_sets.rb, line 187
def file_node_for_file( without_extension_string )
  file_node = @file_nodes_by_name[ without_extension_string ]

  if file_node.nil?
    file_node = ObjCFileNode.new( self, without_extension_string )
    @file_nodes_by_name[ without_extension_string ] = file_node
  end

  return file_node
end
process_file( path ) click to toggle source
# File lib/objc2swift_assistant/file_sets.rb, line 167
def process_file( path )
  basename = path.basename

  without_extension = path.basename(".h") || path.basename(".hh")
  if without_extension != basename
    file_node = file_node_for_file( without_extension.to_s )
    file_node.header_file_path = path
    return
  end

  without_extension = path.basename(".m") || path.basename(".mm")
  if without_extension != basename
    file_node = file_node_for_file( without_extension.to_s )
    file_node.implementation_file_path = path
    return
  end

  @file_set.configuration.log_verbose( "File not captured:#{path.to_s}")
end