本文整理汇总了C++中Extent::first方法的典型用法代码示例。如果您正苦于以下问题:C++ Extent::first方法的具体用法?C++ Extent::first怎么用?C++ Extent::first使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Extent
的用法示例。
在下文中一共展示了Extent::first方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: s
/** Returns a list of parts of a single section that have been referenced. The offsets are relative to the start of the
* section. */
ExtentMap
SgAsmGenericSection::get_referenced_extents() const
{
ExtentMap retval;
if (0==get_size())
return retval;
Extent s(get_offset(), get_size());
const ExtentMap &file_extents = get_file()->get_referenced_extents();
for (ExtentMap::const_iterator i=file_extents.begin(); i!=file_extents.end(); i++) {
Extent e = i->first;
if (e.contained_in(s)) {
retval.insert(Extent(e.first()-get_offset(), e.size()));
} else if (e.left_of(s) || e.right_of(s)) {
/*void*/
} else if (e.contains(s)) {
retval.insert(Extent(0, get_size()));
} else if (e.begins_before(s)) {
retval.insert(Extent(0, e.first()+e.size()-get_offset()));
} else if (e.ends_after(s)) {
retval.insert(Extent(e.first()-get_offset(), get_offset()+get_size()-e.first()));
} else {
assert(!"invalid extent overlap category");
abort();
}
}
return retval;
}
示例2: Nothing
Sawyer::Optional<rose_addr_t>
MemoryMap::findAny(const Extent &limits, const std::vector<uint8_t> &bytesToFind,
unsigned requiredPerms, unsigned prohibitedPerms) const {
if (limits.empty() || bytesToFind.empty())
return Sawyer::Nothing();
AddressInterval interval = AddressInterval::hull(limits.first(), limits.last());
return findAny(interval, bytesToFind, requiredPerms, prohibitedPerms);
}
示例3: assert
/** Write just the specified regions back to the file */
void
SgAsmGenericSection::unparse(std::ostream &f, const ExtentMap &map) const
{
for (ExtentMap::const_iterator i=map.begin(); i!=map.end(); ++i) {
Extent e = i->first;
assert(e.first()+e.size() <= get_size());
const unsigned char *extent_data;
if (e.first() >= p_data.size()) {
extent_data = NULL;
} else if (e.first() + e.size() > p_data.size()) {
extent_data = &p_data[e.first()];
} else {
extent_data = &p_data[e.first()];
}
if (extent_data)
write(f, e.first(), e.size(), extent_data);
}
}
示例4: toAddressInterval
AddressInterval toAddressInterval(const Extent &x) {
return x.empty() ? AddressInterval() : AddressInterval::hull(x.first(), x.last());
}