本文整理汇总了C++中XML_PARSER::parse_int方法的典型用法代码示例。如果您正苦于以下问题:C++ XML_PARSER::parse_int方法的具体用法?C++ XML_PARSER::parse_int怎么用?C++ XML_PARSER::parse_int使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XML_PARSER
的用法示例。
在下文中一共展示了XML_PARSER::parse_int方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parse
int PROXY_INFO::parse(XML_PARSER& xp) {
memset(this, 0, sizeof(PROXY_INFO));
while (!xp.get_tag()) {
if (xp.match_tag("/proxy_info")) {
present = false;
if (strlen(http_server_name)) present = true;
if (strlen(socks_server_name)) present = true;
return 0;
}
if (xp.parse_bool("use_http_proxy", use_http_proxy)) continue;
if (xp.parse_bool("use_socks_proxy", use_socks_proxy)) continue;
if (xp.parse_bool("use_http_auth", use_http_auth)) continue;
if (xp.parse_str("socks_server_name", socks_server_name, sizeof(socks_server_name))) continue;
if (xp.parse_int("socks_server_port", socks_server_port)) continue;
if (xp.parse_str("http_server_name", http_server_name, sizeof(http_server_name))) continue;
if (xp.parse_int("http_server_port", http_server_port)) continue;
if (xp.parse_str("socks5_user_name", socks5_user_name,sizeof(socks5_user_name))) continue;
if (xp.parse_str("socks5_user_passwd", socks5_user_passwd,sizeof(socks5_user_passwd))) continue;
if (xp.parse_bool("socks5_remote_dns", socks5_remote_dns)) continue;
if (xp.parse_str("http_user_name", http_user_name,sizeof(http_user_name))) continue;
if (xp.parse_str("http_user_passwd", http_user_passwd,sizeof(http_user_passwd))) continue;
if (xp.parse_str("no_proxy", noproxy_hosts, sizeof(noproxy_hosts))) continue;
if (xp.parse_bool("no_autodetect", no_autodetect)) continue;
}
return ERR_XML_PARSE;
}
示例2: parse_from_client
int SCHED_DB_RESULT::parse_from_client(XML_PARSER& xp) {
double dtemp;
bool btemp;
string stemp;
int itemp;
// should be non-zero if exit_status is not found
exit_status = ERR_NO_EXIT_STATUS;
memset(this, 0, sizeof(*this));
while (!xp.get_tag()) {
if (xp.match_tag("/result")) {
return 0;
}
if (xp.parse_str("name", name, sizeof(name))) continue;
if (xp.parse_int("state", client_state)) continue;
if (xp.parse_double("final_cpu_time", cpu_time)) continue;
if (xp.parse_double("final_elapsed_time", elapsed_time)) continue;
if (xp.parse_int("exit_status", exit_status)) continue;
if (xp.parse_int("app_version_num", app_version_num)) continue;
if (xp.match_tag("file_info")) {
string s;
xp.copy_element(s);
safe_strcat(xml_doc_out, s.c_str());
continue;
}
if (xp.match_tag("stderr_out" )) {
copy_element_contents(xp.f->f, "</stderr_out>", stderr_out, sizeof(stderr_out));
continue;
}
if (xp.parse_string("platform", stemp)) continue;
if (xp.parse_int("version_num", itemp)) continue;
if (xp.parse_string("plan_class", stemp)) continue;
if (xp.parse_double("completed_time", dtemp)) continue;
if (xp.parse_string("file_name", stemp)) continue;
if (xp.match_tag("file_ref")) {
xp.copy_element(stemp);
continue;
}
if (xp.parse_string("open_name", stemp)) continue;
if (xp.parse_bool("ready_to_report", btemp)) continue;
if (xp.parse_double("report_deadline", dtemp)) continue;
if (xp.parse_string("wu_name", stemp)) continue;
// deprecated stuff
if (xp.parse_double("fpops_per_cpu_sec", dtemp)) continue;
if (xp.parse_double("fpops_cumulative", dtemp)) continue;
if (xp.parse_double("intops_per_cpu_sec", dtemp)) continue;
if (xp.parse_double("intops_cumulative", dtemp)) continue;
log_messages.printf(MSG_NORMAL,
"RESULT::parse_from_client(): unrecognized: %s\n",
xp.parsed_tag
);
}
return ERR_XML_PARSE;
}
示例3: parse
int HOST::parse(XML_PARSER& xp) {
p_ncpus = 1;
double dtemp;
string stemp;
while (!xp.get_tag()) {
if (xp.match_tag("/host_info")) return 0;
if (xp.parse_int("timezone", timezone)) continue;
if (xp.parse_str("domain_name", domain_name, sizeof(domain_name))) continue;
if (xp.parse_str("ip_addr", last_ip_addr, sizeof(last_ip_addr))) continue;
if (xp.parse_str("host_cpid", host_cpid, sizeof(host_cpid))) continue;
if (xp.parse_int("p_ncpus", p_ncpus)) continue;
if (xp.parse_str("p_vendor", p_vendor, sizeof(p_vendor))) continue;
if (xp.parse_str("p_model", p_model, sizeof(p_model))) continue;
if (xp.parse_double("p_fpops", p_fpops)) continue;
if (xp.parse_double("p_iops", p_iops)) continue;
if (xp.parse_double("p_membw", p_membw)) continue;
if (xp.parse_str("os_name", os_name, sizeof(os_name))) continue;
if (xp.parse_str("os_version", os_version, sizeof(os_version))) continue;
if (xp.parse_double("m_nbytes", m_nbytes)) continue;
if (xp.parse_double("m_cache", m_cache)) continue;
if (xp.parse_double("m_swap", m_swap)) continue;
if (xp.parse_double("d_total", d_total)) continue;
if (xp.parse_double("d_free", d_free)) continue;
if (xp.parse_double("n_bwup", n_bwup)) continue;
if (xp.parse_double("n_bwdown", n_bwdown)) continue;
if (xp.parse_str("p_features", p_features, sizeof(p_features))) continue;
if (xp.parse_str("virtualbox_version", virtualbox_version, sizeof(virtualbox_version))) continue;
if (xp.parse_bool("p_vm_extensions_disabled", p_vm_extensions_disabled)) continue;
// parse deprecated fields to avoid error messages
//
if (xp.parse_double("p_calculated", dtemp)) continue;
if (xp.match_tag("p_fpop_err")) continue;
if (xp.match_tag("p_iop_err")) continue;
if (xp.match_tag("p_membw_err")) continue;
// fields reported by 5.5+ clients, not currently used
//
if (xp.parse_string("p_capabilities", stemp)) continue;
if (xp.parse_string("accelerators", stemp)) continue;
#if 1
// not sure where these fields belong in the above categories
//
if (xp.parse_string("cpu_caps", stemp)) continue;
if (xp.parse_string("cache_l1", stemp)) continue;
if (xp.parse_string("cache_l2", stemp)) continue;
if (xp.parse_string("cache_l3", stemp)) continue;
#endif
log_messages.printf(MSG_NORMAL,
"HOST::parse(): unrecognized: %s\n", xp.parsed_tag
);
}
return ERR_XML_PARSE;
}
示例4: parse
int PCI_INFO::parse(XML_PARSER& xp) {
present = false;
bus_id = device_id = domain_id = 0;
while (!xp.get_tag()) {
if (xp.match_tag("/pci_info")) {
return 0;
}
if (xp.parse_int("bus_id", bus_id)) continue;
if (xp.parse_int("device_id", device_id)) continue;
if (xp.parse_int("domain_id", domain_id)) continue;
}
return ERR_XML_PARSE;
}
示例5: parse
int HOST_INFO::parse(XML_PARSER& xp, bool benchmarks_only) {
while (!xp.get_tag()) {
if (xp.match_tag("/host_info")) return 0;
if (xp.parse_double("p_fpops", p_fpops)) {
// fix foolishness that could result in negative value here
//
if (p_fpops < 0) p_fpops = -p_fpops;
continue;
}
if (xp.parse_double("p_iops", p_iops)) {
if (p_iops < 0) p_iops = -p_iops;
continue;
}
if (xp.parse_double("p_membw", p_membw)) {
if (p_membw < 0) p_membw = -p_membw;
continue;
}
if (xp.parse_double("p_calculated", p_calculated)) continue;
if (xp.parse_bool("p_vm_extensions_disabled", p_vm_extensions_disabled)) continue;
if (benchmarks_only) continue;
// WARNING: NOTHING AFTER HERE IS READ FROM STATE FILE ON THE CLIENT
if (xp.parse_int("timezone", timezone)) continue;
if (xp.parse_str("domain_name", domain_name, sizeof(domain_name))) continue;
if (xp.parse_str("ip_addr", ip_addr, sizeof(ip_addr))) continue;
if (xp.parse_str("host_cpid", host_cpid, sizeof(host_cpid))) continue;
if (xp.parse_int("p_ncpus", p_ncpus)) continue;
if (xp.parse_str("p_vendor", p_vendor, sizeof(p_vendor))) continue;
if (xp.parse_str("p_model", p_model, sizeof(p_model))) continue;
if (xp.parse_str("p_features", p_features, sizeof(p_features))) {
downcase_string(p_features);
continue;
}
if (xp.parse_double("m_nbytes", m_nbytes)) continue;
if (xp.parse_double("m_cache", m_cache)) continue;
if (xp.parse_double("m_swap", m_swap)) continue;
if (xp.parse_double("d_total", d_total)) continue;
if (xp.parse_double("d_free", d_free)) continue;
if (xp.parse_str("os_name", os_name, sizeof(os_name))) continue;
if (xp.parse_str("os_version", os_version, sizeof(os_version))) continue;
if (xp.parse_str("virtualbox_version", virtualbox_version, sizeof(virtualbox_version))) continue;
if (xp.match_tag("coprocs")) {
this->coprocs.parse(xp);
}
}
return ERR_XML_PARSE;
}
示例6: parse_server
// parse a <result> element from scheduling server.
//
int RESULT::parse_server(XML_PARSER& xp) {
FILE_REF file_ref;
clear();
while (!xp.get_tag()) {
if (xp.match_tag("/result")) return 0;
if (xp.parse_str("name", name, sizeof(name))) continue;
if (xp.parse_str("wu_name", wu_name, sizeof(wu_name))) continue;
if (xp.parse_double("report_deadline", report_deadline)) continue;
if (xp.parse_str("platform", platform, sizeof(platform))) continue;
if (xp.parse_str("plan_class", plan_class, sizeof(plan_class))) continue;
if (xp.parse_int("version_num", version_num)) continue;
if (xp.match_tag("file_ref")) {
file_ref.parse(xp);
output_files.push_back(file_ref);
continue;
}
if (xp.parse_bool("report_immediately", report_immediately)) continue;
if (log_flags.unparsed_xml) {
msg_printf(0, MSG_INFO,
"[unparsed_xml] RESULT::parse(): unrecognized: %s\n",
xp.parsed_tag
);
}
xp.skip_unexpected();
}
return ERR_XML_PARSE;
}
示例7: parse
int APP_CONFIG::parse(XML_PARSER& xp, PROJECT* p) {
memset(this, 0, sizeof(APP_CONFIG));
while (!xp.get_tag()) {
if (xp.match_tag("/app")) return 0;
if (xp.parse_str("name", name, 256)) continue;
if (xp.parse_int("max_concurrent", max_concurrent)) {
if (max_concurrent) have_max_concurrent = true;
continue;
}
if (xp.match_tag("gpu_versions")) {
while (!xp.get_tag()) {
if (xp.match_tag("/gpu_versions")) break;
if (xp.parse_double("gpu_usage", gpu_gpu_usage)) continue;
if (xp.parse_double("cpu_usage", gpu_cpu_usage)) continue;
}
continue;
}
if (log_flags.unparsed_xml) {
msg_printf(p, MSG_INFO,
"Unparsed line in app_info.xml: %s",
xp.parsed_tag
);
}
xp.skip_unexpected(log_flags.unparsed_xml, "APP_CONFIG::parse");
}
return ERR_XML_PARSE;
}
示例8: parse
int APP_CONFIG::parse(XML_PARSER& xp, MSG_VEC& mv, LOG_FLAGS& log_flags) {
char buf[1024];
memset(this, 0, sizeof(APP_CONFIG));
while (!xp.get_tag()) {
if (xp.match_tag("/app")) return 0;
if (xp.parse_str("name", name, 256)) continue;
if (xp.parse_int("max_concurrent", max_concurrent)) {
if (max_concurrent) have_max_concurrent = true;
continue;
}
if (xp.match_tag("gpu_versions")) {
int retval = parse_gpu_versions(xp, mv, log_flags);
if (retval) return retval;
continue;
}
if (xp.parse_bool("fraction_done_exact", fraction_done_exact)) {
continue;
}
if (xp.parse_bool("report_results_immediately", report_results_immediately)) {
continue;
}
// unparsed XML not considered an error; maybe it should be?
//
if (log_flags.unparsed_xml) {
sprintf(buf, "Unparsed line in app_config.xml: %s", xp.parsed_tag);
mv.push_back(string(buf));
}
xp.skip_unexpected(log_flags.unparsed_xml, "APP_CONFIG::parse");
}
mv.push_back(string("Missing </app> in app_config.xml"));
return ERR_XML_PARSE;
}
示例9: parse
int TASK::parse(XML_PARSER& xp) {
char buf[8192];
weight = 1;
current_cpu_time = 0;
final_cpu_time = 0;
stat_first = true;
pid = 0;
is_daemon = false;
multi_process = false;
append_cmdline_args = false;
time_limit = 0;
priority = PROCESS_PRIORITY_LOWEST;
while (!xp.get_tag()) {
if (!xp.is_tag) {
fprintf(stderr, "%s TASK::parse(): unexpected text %s\n",
boinc_msg_prefix(buf, sizeof(buf)), xp.parsed_tag
);
continue;
}
if (xp.match_tag("/task")) {
return 0;
}
else if (xp.parse_string("application", application)) continue;
else if (xp.parse_str("exec_dir", buf, sizeof(buf))) {
macro_substitute(buf);
exec_dir = buf;
continue;
}
else if (xp.parse_str("setenv", buf, sizeof(buf))) {
macro_substitute(buf);
vsetenv.push_back(buf);
continue;
}
else if (xp.parse_string("stdin_filename", stdin_filename)) continue;
else if (xp.parse_string("stdout_filename", stdout_filename)) continue;
else if (xp.parse_string("stderr_filename", stderr_filename)) continue;
else if (xp.parse_str("command_line", buf, sizeof(buf))) {
macro_substitute(buf);
command_line = buf;
continue;
}
else if (xp.parse_string("checkpoint_filename", checkpoint_filename)) continue;
else if (xp.parse_string("fraction_done_filename", fraction_done_filename)) continue;
else if (xp.parse_double("weight", weight)) continue;
else if (xp.parse_bool("daemon", is_daemon)) continue;
else if (xp.parse_bool("multi_process", multi_process)) continue;
else if (xp.parse_bool("append_cmdline_args", append_cmdline_args)) continue;
else if (xp.parse_double("time_limit", time_limit)) continue;
else if (xp.parse_int("priority", priority)) continue;
}
return ERR_XML_PARSE;
}
示例10: parse
int DAILY_XFER::parse(XML_PARSER& xp) {
char tag[1024];
bool is_tag;
while (!xp.get(tag, sizeof(tag), is_tag)) {
if (!strcmp(tag, "/dx")) return 0;
if (xp.parse_int(tag, "when", when)) continue;
if (xp.parse_double(tag, "up", up)) continue;
if (xp.parse_double(tag, "down", down)) continue;
}
return ERR_XML_PARSE;
}
示例11: parse
int COMPLETED_JOB_DESC::parse(XML_PARSER& xp) {
canonical_resultid = 0;
error_mask = 0;
error_resultid = 0;
exit_status = 0;
elapsed_time = 0;
cpu_time = 0;
while (!xp.get_tag()) {
if (xp.match_tag("/completed_job")) return 0;
if (xp.parse_int("canonical_resultid", canonical_resultid)) continue;
if (xp.parse_int("error_mask", error_mask)) continue;
if (xp.parse_int("error_resultid", error_resultid)) continue;
if (xp.parse_int("exit_status", exit_status)) continue;
if (xp.parse_double("elapsed_time", elapsed_time)) continue;
if (xp.parse_double("cpu_time", cpu_time)) continue;
if (xp.parse_string("stderr_out", stderr_out)) {
xml_unescape(stderr_out);
continue;
}
}
return ERR_XML_PARSE;
}
示例12: parse
int WORKUNIT::parse(XML_PARSER& xp) {
FILE_REF file_ref;
double dtemp;
strcpy(name, "");
strcpy(app_name, "");
version_num = 0;
command_line = "";
//strcpy(env_vars, "");
app = NULL;
project = NULL;
// Default these to very large values (1 week on a 1 cobblestone machine)
// so we don't keep asking the server for more work
rsc_fpops_est = 1e9*SECONDS_PER_DAY*7;
rsc_fpops_bound = 4e9*SECONDS_PER_DAY*7;
rsc_memory_bound = 1e8;
rsc_disk_bound = 1e9;
while (!xp.get_tag()) {
if (xp.match_tag("/workunit")) return 0;
if (xp.parse_str("name", name, sizeof(name))) continue;
if (xp.parse_str("app_name", app_name, sizeof(app_name))) continue;
if (xp.parse_int("version_num", version_num)) continue;
if (xp.parse_string("command_line", command_line)) {
strip_whitespace(command_line);
continue;
}
//if (xp.parse_str("env_vars", env_vars, sizeof(env_vars))) continue;
if (xp.parse_double("rsc_fpops_est", rsc_fpops_est)) continue;
if (xp.parse_double("rsc_fpops_bound", rsc_fpops_bound)) continue;
if (xp.parse_double("rsc_memory_bound", rsc_memory_bound)) continue;
if (xp.parse_double("rsc_disk_bound", rsc_disk_bound)) continue;
if (xp.match_tag("file_ref")) {
file_ref.parse(xp);
#ifndef SIM
input_files.push_back(file_ref);
#endif
continue;
}
// unused stuff
if (xp.parse_double("credit", dtemp)) continue;
if (log_flags.unparsed_xml) {
msg_printf(0, MSG_INFO,
"[unparsed_xml] WORKUNIT::parse(): unrecognized: %s\n",
xp.parsed_tag
);
}
xp.skip_unexpected();
}
return ERR_XML_PARSE;
}
示例13: parse
int VBOX_PORT_FORWARD::parse(XML_PARSER& xp) {
while (!xp.get_tag()) {
if (xp.match_tag("/port_forward")) {
if (!host_port) {
vboxlog_msg("VBOX_PORT_FORWARD::parse(): unspecified host port");
return ERR_XML_PARSE;
}
if (!guest_port) {
vboxlog_msg("VBOX_PORT_FORWARD::parse(): unspecified guest port");
return ERR_XML_PARSE;
}
return 0;
}
else if (xp.parse_bool("is_remote", is_remote)) continue;
else if (xp.parse_int("host_port", host_port)) continue;
else if (xp.parse_int("guest_port", guest_port)) continue;
else if (xp.parse_int("nports", nports)) continue;
else {
vboxlog_msg("VBOX_PORT_FORWARD::parse(): unexpected text %s", xp.parsed_tag);
}
}
return ERR_XML_PARSE;
}
示例14: parse
int FILE_INFO::parse(XML_PARSER& xp) {
memset(this, 0, sizeof(*this));
while (!xp.get_tag()) {
if (xp.match_tag("/file_info")) {
if (!strlen(name)) return ERR_XML_PARSE;
return 0;
}
if (xp.parse_str("name", name, 256)) continue;
if (xp.parse_double("nbytes", nbytes)) continue;
if (xp.parse_int("status", status)) continue;
if (xp.parse_bool("sticky", sticky)) continue;
}
return ERR_XML_PARSE;
}
示例15: parse
int RSC_JOB_LIMIT::parse(XML_PARSER& xp, const char* end_tag) {
per_proc = false;
while (!xp.get_tag()) {
if (!xp.is_tag) {
continue;
}
if (xp.match_tag(end_tag)) {
return 0;
}
if (xp.parse_int("jobs", base_limit)) {
continue;
}
if (xp.parse_bool("per_proc", per_proc)) {
continue;
}
}
return ERR_XML_PARSE;
}