本文整理汇总了C++中MIOFILE::init_buf_read方法的典型用法代码示例。如果您正苦于以下问题:C++ MIOFILE::init_buf_read方法的具体用法?C++ MIOFILE::init_buf_read怎么用?C++ MIOFILE::init_buf_read使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MIOFILE
的用法示例。
在下文中一共展示了MIOFILE::init_buf_read方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handle_set_proxy_settings
static void handle_set_proxy_settings(char* buf, MIOFILE& fout) {
MIOFILE in;
in.init_buf_read(buf);
gui_proxy_info.parse(in);
gstate.set_client_state_dirty("Set proxy settings RPC");
fout.printf("<success/>\n");
select_proxy_info();
// tell running apps to reread app_info file (for [email protected])
//
gstate.active_tasks.request_reread_app_info();
}
示例2: parse_buffer_embed
int CERT_SIGS::parse_buffer_embed(char* buf) {
MIOFILE mf;
char tag[4096];
int is_tag;
int s_found = false;
mf.init_buf_read(buf);
XML_PARSER xp(&mf);
while (!xp.get(tag, sizeof(tag), (bool&)is_tag)) {
if (!strcmp(tag, "signatures")) {
s_found = true;
break;
}
}
if (s_found)
return this->parse(xp);
else
return false;
}
示例3: handle_battery_info
/*
* request: receive battery info
*/
static void handle_battery_info(char* buf, bool is_local, MIOFILE& fout) {
if (is_local) {
MIOFILE in;
in.init_buf_read(buf);
if (gstate.battery_info.parse(in)!=0)
return;
/*msg_printf(0, MSG_INFO, "Battery info reveived: %s,%s,%f,%f\n",
gstate.battery_info.present?"1":"0",
gstate.battery_info.plugged?"1":"0",
gstate.battery_info.level,
gstate.battery_info.temperature);*/
gstate.battery_info_initialized = true;
fout.printf("<success/>\n");
} else { // no access if not local
fout.printf("<failed/>\n");
return;
}
}
示例4: get_output_file_info
int get_output_file_info(RESULT& result, FILE_INFO& fi) {
char path[1024];
string name;
MIOFILE mf;
mf.init_buf_read(result.xml_doc_in);
XML_PARSER xp(&mf);
while (!xp.get_tag()) {
if (!xp.is_tag) continue;
if (xp.match_tag("file_ref")) {
int retval = fi.parse(xp);
if (retval) return retval;
dir_hier_path(
fi.name.c_str(), config.upload_dir, config.uldl_dir_fanout, path
);
fi.path = path;
return 0;
}
}
return ERR_XML_PARSE;
}
示例5: CreateCheckboxes
void CDlgDiagnosticLogFlags::CreateCheckboxes() {
SET_LOCALE sl;
char buf[64000];
MIOFILE mf;
bool val;
m_checkbox_list.clear();
mf.init_buf_write(buf, sizeof(buf));
m_cc_config.write(mf, log_flags);
mf.init_buf_read(buf);
XML_PARSER xp(&mf);
while (!xp.get_tag()) {
if (!xp.is_tag) {
continue;
}
if (xp.match_tag("log_flags")) break;
}
while (!xp.get_tag()) {
if (!xp.is_tag) {
continue;
}
if (xp.match_tag("/log_flags")) break;
wxString label = wxString(xp.parsed_tag);
xp.parse_bool(xp.parsed_tag, val);
wxCheckBox* ckbox = new wxCheckBox(m_scrolledWindow, wxID_ANY, label);
m_checkboxSizer->Add(ckbox, 0, wxLEFT, 25);
m_checkbox_list.push_back(ckbox);
ckbox->SetValue(val);
}
m_scrolledWindow->SetSizer( m_checkboxSizer );
m_scrolledWindow->Layout();
m_checkboxSizer->Fit( m_scrolledWindow );
}
示例6: get_output_file_infos
int get_output_file_infos(RESULT& result, vector<FILE_INFO>& fis) {
char path[1024];
MIOFILE mf;
string name;
mf.init_buf_read(result.xml_doc_in);
XML_PARSER xp(&mf);
fis.clear();
while (!xp.get_tag()) {
if (!xp.is_tag) continue;
if (xp.match_tag("file_ref")) {
FILE_INFO fi;
int retval = fi.parse(xp);
if (retval) return retval;
dir_hier_path(
fi.name.c_str(), config.upload_dir, config.uldl_dir_fanout, path
);
fi.path = path;
fis.push_back(fi);
}
}
return 0;
}