Sha256: f49da6c0462159bd5ae151f62d0b71fc33f72f1b51c35bb056598987eaab3209

Contents?: true

Size: 819 Bytes

Versions: 2

Compression:

Stored size: 819 Bytes

Contents

#!/usr/bin/env ruby
# -*- coding: binary -*-

# Rex::Struct2
module Rex
module Struct2

class CStructTemplate

	require 'rex/struct2/c_struct'

	attr_reader  :template, :template_create_restraints, :template_apply_restraint
	attr_writer  :template, :template_create_restraints, :template_apply_restraint

	def initialize(*tem)
		self.template = tem
		self.template_create_restraints = [ ]
		self.template_apply_restraint = [ ]
	end

	def create_restraints(*ress)
		self.template_create_restraints = ress
		return self
	end

	def apply_restraint(*ress)
		self.template_apply_restraint = ress
		return self
	end

	def make_struct
		Rex::Struct2::CStruct.new(*self.template).
		  create_restraints(*self.template_create_restraints).
		  apply_restraint(*self.template_apply_restraint)
	end
end

# end Rex::Struct2
end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
librex-0.0.68 lib/rex/struct2/c_struct_template.rb
librex-0.0.66 lib/rex/struct2/c_struct_template.rb