本文整理汇总了C++中qvector::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ qvector::empty方法的具体用法?C++ qvector::empty怎么用?C++ qvector::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qvector
的用法示例。
在下文中一共展示了qvector::empty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: object_explorer_form_init
void object_explorer_form_init()
{
if (!vtbl_list.empty() && !vtbl_t_list.empty())
{
HWND hwnd = NULL;
TForm *form = create_tform("Object Explorer", &hwnd);
if (hwnd == NULL)
{
warning("Object Explorer window already open. Switching to it.");
form = find_tform("Object Explorer");
if (form != NULL)
switchto_tform(form, true);
return;
}
object_explorer_info_t *si = new object_explorer_info_t(form);
qvector <qstring>::iterator vtbl_iter;
for (vtbl_iter = vtbl_list.begin(); vtbl_iter != vtbl_list.end(); vtbl_iter++)
si->sv.push_back(simpleline_t(*vtbl_iter));
simpleline_place_t s1;
simpleline_place_t s2(si->sv.size() - 1);
si->cv = create_custom_viewer("", NULL, &s1, &s2, &s1, 0, &si->sv);
si->codeview = create_code_viewer(form, si->cv, CDVF_STATUSBAR);
set_custom_viewer_handlers(si->cv, ct_object_explorer_keyboard, ct_object_explorer_popup, ct_object_explorer_click, NULL, NULL, si);
hook_to_notification_point(HT_UI, ui_object_explorer_callback, si);
open_tform(form, FORM_TAB | FORM_MENU | FORM_RESTORE);
}
else
warning("ObjectExplorer not found any virtual tables here ...");
}
示例2:
static bool idaapi show_rtti_window_cb(void *ud)
{
if (!rtti_list.empty() && !rtti_addr.empty())
{
HWND hwnd = NULL;
TForm *form = create_tform("RTTI Objects List", &hwnd);
object_explorer_info_t *si = new object_explorer_info_t(form);
qvector <qstring>::iterator rtti_iter;
for (rtti_iter = rtti_list.begin(); rtti_iter != rtti_list.end(); rtti_iter++)
si->sv.push_back(simpleline_t(*rtti_iter));
simpleline_place_t s1;
simpleline_place_t s2(si->sv.size() - 1);
si->cv = create_custom_viewer("", NULL, &s1, &s2, &s1, 0, &si->sv);
si->codeview = create_code_viewer(form, si->cv, CDVF_STATUSBAR);
set_custom_viewer_handlers(si->cv, NULL, NULL, ct_rtti_window_click, NULL, NULL, si);
open_tform(form, FORM_ONTOP | FORM_RESTORE);
return true;
}
warning("ObjectExplorer not found any RTTI objects ...");
return false;
}
示例3: merge_types
tid_t idaapi merge_types(const qvector<qstring>& types_to_merge, const qstring& type_name) {
tid_t struct_type_id = BADADDR;
if (types_to_merge.empty())
return struct_type_id;
std::set<ea_t> offsets;
struct_type_id = add_struc(BADADDR, type_name.c_str());
if (struct_type_id == BADADDR)
return struct_type_id;
struc_t * struc = get_struc(struct_type_id);
if (!struc)
return struct_type_id;
for (auto types_iter = types_to_merge.begin(), end = types_to_merge.end(); types_iter != end; ++types_iter) {
struc_t * struc_type = get_struc(get_struc_id(types_iter->c_str()));
if (!struc_type)
continue;
// enumerate members
for ( ea_t offset = get_struc_first_offset(struc_type) ; offset != BADADDR ; offset = get_struc_next_offset(struc_type, offset)) {
member_t * member_info = get_member(struc_type, offset);
if (!member_info)
continue;
if (offsets.count(member_info->soff) == 0) {
qstring member_name = get_member_name(member_info->id);
asize_t member_size = get_member_size(member_info);
if (member_name.find("vftbl_", 0) != -1) {
tinfo_t tif;
if (get_member_tinfo(&tif, member_info)) {
add_struc_member(struc, member_name.c_str(), member_info->soff, dword_flag(), NULL, member_size);
if (member_t * membr = get_member(struc, member_info->soff)) {
set_member_tinfo(struc, membr, 0, tif, SET_MEMTI_COMPATIBLE);
}
}
}
else {
add_struc_member(struc, member_name.c_str(), member_info->soff, member_info->flag, NULL, member_size);
}
offsets.insert(member_info->soff);
}
}
}
return struct_type_id;
}