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/android.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,
lib/ronin/support/binary/ctypes/os/apple_ios.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: Android, AppleIOS, 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.
73 74 75 76 |
# File 'lib/ronin/support/binary/ctypes/os.rb', line 73 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.
53 54 55 |
# File 'lib/ronin/support/binary/ctypes/os.rb', line 53 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.
48 49 50 |
# File 'lib/ronin/support/binary/ctypes/os.rb', line 48 def types @types end |
Instance Method Details
#[](name) ⇒ Type
Retrieves the type with the given name.
87 88 89 |
# File 'lib/ronin/support/binary/ctypes/os.rb', line 87 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.
106 107 108 109 110 111 112 113 |
# File 'lib/ronin/support/binary/ctypes/os.rb', line 106 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 |