mirror of
https://github.com/robmcmullen/atrcopy.git
synced 2024-12-27 23:32:06 +00:00
Added convenience function get_raw_index_from_address
This commit is contained in:
parent
e74b3b5b34
commit
f0c263b588
@ -582,6 +582,12 @@ class DefaultSegment(object):
|
||||
"""
|
||||
return self.rawdata.get_raw_index(i)
|
||||
|
||||
def get_raw_index_from_address(self, addr):
|
||||
"""Get index into base array's raw data, given the address of a byte
|
||||
into this segment
|
||||
"""
|
||||
return self.get_raw_index(addr - self.start_addr)
|
||||
|
||||
def get_index_from_base_index(self, base_index):
|
||||
"""Get index into this array's data given the index into the base array
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user