Class: Ronin::Support::Binary::CTypes::OS Private
- Inherits:
-
Object
- Object
- Ronin::Support::Binary::CTypes::OS
- Defined in:
- lib/ronin/support/binary/ctypes/os.rb,
lib/ronin/support/binary/ctypes/os/bsd.rb,
lib/ronin/support/binary/ctypes/os/unix.rb,
lib/ronin/support/binary/ctypes/os/linux.rb,
lib/ronin/support/binary/ctypes/os/macos.rb,
lib/ronin/support/binary/ctypes/os/netbsd.rb,
lib/ronin/support/binary/ctypes/os/freebsd.rb,
lib/ronin/support/binary/ctypes/os/openbsd.rb,
lib/ronin/support/binary/ctypes/os/windows.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Represents additional typedefs defined by an Operating System (OS).
Defined Under Namespace
Classes: BSD, FreeBSD, Linux, MacOS, NetBSD, OpenBSD, UNIX, Windows
Instance Attribute Summary collapse
-
#typedefs ⇒ Hash{Symbol => Type}
readonly
private
The defined typedefs for the OS.
-
#types ⇒ Native, ...
readonly
private
The base types that the OS inherits.
Instance Method Summary collapse
-
#[](name) ⇒ Type
Retrieves the type with the given name.
-
#initialize(types) ⇒ OS
constructor
private
Initializes the OS with the given base types.
-
#typedef(type, new_name) ⇒ Object
private
Defines a typedef within the type system.
Constructor Details
#initialize(types) ⇒ OS
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initializes the OS with the given base types.
The base types that the OS builds upon.
70 71 72 73 |
# File 'lib/ronin/support/binary/ctypes/os.rb', line 70 def initialize(types) @types = types @typedefs = {} end |
Instance Attribute Details
#typedefs ⇒ Hash{Symbol => Type} (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The defined typedefs for the OS.
51 52 53 |
# File 'lib/ronin/support/binary/ctypes/os.rb', line 51 def typedefs @typedefs end |
#types ⇒ Native, ... (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The base types that the OS inherits.
46 47 48 |
# File 'lib/ronin/support/binary/ctypes/os.rb', line 46 def types @types end |
Instance Method Details
#[](name) ⇒ Type
Retrieves the type with the given name.
84 85 86 |
# File 'lib/ronin/support/binary/ctypes/os.rb', line 84 def [](name) @typedefs.fetch(name) { @types[name] } end |
#typedef(type, new_name) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Defines a typedef within the type system.
103 104 105 106 107 108 109 110 |
# File 'lib/ronin/support/binary/ctypes/os.rb', line 103 def typedef(type,new_name) case type when Type then @typedefs[new_name] = type when Symbol then @typedefs[new_name] = self[type] else raise(ArgumentError,"type must be either a Symbol or a #{Type}: #{type.inspect}") end end |