bool resource_directory::entry_finder::operator()(const resource_directory_entry& entry) const
{
    if(named_)
        return entry.is_named() && entry.get_name() == name_;
    else
        return !entry.is_named() && entry.get_id() == id_;
}
//Helper function to rebuild resource directory
bool entry_sorter::operator()(const resource_directory_entry& entry1, const resource_directory_entry& entry2) const
{
    if(entry1.is_named() && entry2.is_named())
        return entry1.get_name() < entry2.get_name();
    else if(!entry1.is_named() && !entry2.is_named())
        return entry1.get_id() < entry2.get_id();
    else
        return entry1.is_named();
}
//Adds resource_directory_entry
void resource_directory::add_resource_directory_entry(const resource_directory_entry& entry)
{
    entries_.push_back(entry);
    if(entry.is_named())
        ++number_of_named_entries_;
    else
        ++number_of_id_entries_;
}
Пример #4
0
bool pe_resource_viewer::has_id::operator()(const resource_directory_entry& entry) const
{
	return !entry.is_named();
}
bool resource_directory::name_entry_finder::operator()(const resource_directory_entry& entry) const
{
    return entry.is_named() && entry.get_name() == name_;
}
bool resource_directory::id_entry_finder::operator()(const resource_directory_entry& entry) const
{
    return !entry.is_named() && entry.get_id() == id_;
}