本文整理汇总了C++中XML_PARSER::match_tag方法的典型用法代码示例。如果您正苦于以下问题:C++ XML_PARSER::match_tag方法的具体用法?C++ XML_PARSER::match_tag怎么用?C++ XML_PARSER::match_tag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XML_PARSER
的用法示例。
在下文中一共展示了XML_PARSER::match_tag方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parse
int parse(XML_PARSER& xp) {
strcpy(file_name, "");
strcpy(open_name, "");
while (!xp.get_tag()) {
if (!xp.is_tag) continue;
if (xp.match_tag("/file_ref")) {
return 0;
}
if (xp.parse_str("file_name", file_name, sizeof(file_name))) continue;
if (xp.parse_str("open_name", open_name, sizeof(open_name))) continue;
}
return ERR_XML_PARSE;
}
示例2: parse
int NORMAL_DIST::parse(XML_PARSER& xp, const char* end_tag) {
while(!xp.get_tag()) {
if (!xp.is_tag) return ERR_XML_PARSE;
if (xp.parse_double("mean", mean)) continue;
else if (xp.parse_double("std_dev", std_dev)) continue;
else if (xp.match_tag(end_tag)) return 0;
else {
printf("unrecognized: %s\n", xp.parsed_tag);
return ERR_XML_PARSE;
}
}
return ERR_XML_PARSE;
}
示例3: parse
int APP::parse(XML_PARSER& xp) {
strcpy(name, "");
strcpy(user_friendly_name, "");
project = NULL;
non_cpu_intensive = false;
while (!xp.get_tag()) {
if (xp.match_tag("/app")) {
if (!strlen(user_friendly_name)) {
strcpy(user_friendly_name, name);
}
return 0;
}
if (xp.parse_str("name", name, sizeof(name))) continue;
if (xp.parse_str("user_friendly_name", user_friendly_name, sizeof(user_friendly_name))) continue;
if (xp.parse_bool("non_cpu_intensive", non_cpu_intensive)) continue;
#ifdef SIM
if (xp.parse_double("latency_bound", latency_bound)) continue;
if (xp.parse_double("fpops_est", fpops_est)) continue;
if (xp.parse_double("weight", weight)) continue;
if (xp.parse_double("working_set", working_set)) continue;
if (xp.match_tag("fpops")) {
fpops.parse(xp, "/fpops");
continue;
}
if (xp.match_tag("checkpoint_period")) {
checkpoint_period.parse(xp, "/checkpoint_period");
continue;
}
#endif
if (log_flags.unparsed_xml) {
msg_printf(0, MSG_INFO,
"[unparsed_xml] APP::parse(): unrecognized: %s\n",
xp.parsed_tag
);
}
xp.skip_unexpected();
}
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 APP_CONFIGS::parse(XML_PARSER& xp, PROJECT* p) {
app_configs.clear();
if (!xp.parse_start("app_config")) return ERR_XML_PARSE;
while (!xp.get_tag()) {
if (xp.match_tag("/app_config")) return 0;
if (xp.match_tag("app")) {
APP_CONFIG ac;
int retval = ac.parse(xp, p);
if (!retval) {
app_configs.push_back(ac);
}
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_CONFIGS::parse");
}
return ERR_XML_PARSE;
}
示例6: parse_project_files
int parse_project_files(XML_PARSER& xp, vector<FILE_REF>& project_files) {
int retval;
project_files.clear();
while (!xp.get_tag()) {
if (xp.match_tag("/project_files")) return 0;
if (xp.match_tag("file_ref")) {
FILE_REF file_ref;
retval = file_ref.parse(xp);
if (!retval) {
project_files.push_back(file_ref);
}
} else {
if (log_flags.unparsed_xml) {
msg_printf(0, MSG_INFO,
"[unparsed_xml] parse_project_files(): unrecognized: %s\n",
xp.parsed_tag
);
}
xp.skip_unexpected();
}
}
return ERR_XML_PARSE;
}
示例7: parse
int TEMPLATE_DESC::parse(XML_PARSER& xp) {
int retval;
string s;
while (!xp.get_tag()) {
if (xp.match_tag("input_template")) {
while (!xp.get_tag()) {
if (xp.match_tag("/input_template")) break;
if (xp.parse_string("open_name", s)) {
input_files.push_back(s);
}
}
}
if (xp.match_tag("output_template")) {
while (!xp.get_tag()) {
if (xp.match_tag("/output_template")) break;
if (xp.parse_string("open_name", s)) {
output_files.push_back(s);
}
}
}
}
return 0;
}
示例8: 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;
}
示例9: parse_time_stats
int HOST::parse_time_stats(XML_PARSER& xp) {
while (!xp.get_tag()) {
if (xp.match_tag("/time_stats")) return 0;
if (xp.parse_double("on_frac", on_frac)) continue;
if (xp.parse_double("connected_frac", connected_frac)) continue;
if (xp.parse_double("active_frac", active_frac)) continue;
if (xp.parse_double("gpu_active_frac", gpu_active_frac)) continue;
if (xp.parse_double("cpu_and_network_available_frac", cpu_and_network_available_frac)) continue;
if (xp.parse_double("client_start_time", client_start_time)) continue;
if (xp.parse_double("previous_uptime", previous_uptime)) continue;
#if 0
if (xp.match_tag("outages")) continue;
if (xp.match_tag("outage")) continue;
if (xp.match_tag("start")) continue;
if (xp.match_tag("end")) continue;
log_messages.printf(MSG_NORMAL,
"HOST::parse_time_stats(): unrecognized: %s\n",
xp.parsed_tag
);
#endif
}
return ERR_XML_PARSE;
}
示例10: 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;
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;
}
return ERR_XML_PARSE;
}
示例11: parse
// Parse log flag preferences
//
int LOG_FLAGS::parse(XML_PARSER& xp) {
while (!xp.get_tag()) {
if (!xp.is_tag) {
continue;
}
if (xp.match_tag("/log_flags")) return 0;
if (xp.parse_bool("file_xfer", file_xfer)) continue;
if (xp.parse_bool("sched_ops", sched_ops)) continue;
if (xp.parse_bool("task", task)) continue;
if (xp.parse_bool("app_msg_receive", app_msg_receive)) continue;
if (xp.parse_bool("app_msg_send", app_msg_send)) continue;
if (xp.parse_bool("async_file_debug", async_file_debug)) continue;
if (xp.parse_bool("benchmark_debug", benchmark_debug)) continue;
if (xp.parse_bool("checkpoint_debug", checkpoint_debug)) continue;
if (xp.parse_bool("coproc_debug", coproc_debug)) continue;
if (xp.parse_bool("cpu_sched", cpu_sched)) continue;
if (xp.parse_bool("cpu_sched_debug", cpu_sched_debug)) continue;
if (xp.parse_bool("cpu_sched_status", cpu_sched_status)) continue;
if (xp.parse_bool("dcf_debug", dcf_debug)) continue;
if (xp.parse_bool("disk_usage_debug", disk_usage_debug)) continue;
if (xp.parse_bool("file_xfer_debug", file_xfer_debug)) continue;
if (xp.parse_bool("gui_rpc_debug", gui_rpc_debug)) continue;
if (xp.parse_bool("heartbeat_debug", heartbeat_debug)) continue;
if (xp.parse_bool("http_debug", http_debug)) continue;
if (xp.parse_bool("http_xfer_debug", http_xfer_debug)) continue;
if (xp.parse_bool("mem_usage_debug", mem_usage_debug)) continue;
if (xp.parse_bool("network_status_debug", network_status_debug)) continue;
if (xp.parse_bool("notice_debug", notice_debug)) continue;
if (xp.parse_bool("poll_debug", poll_debug)) continue;
if (xp.parse_bool("priority_debug", priority_debug)) continue;
if (xp.parse_bool("proxy_debug", proxy_debug)) continue;
if (xp.parse_bool("rr_simulation", rr_simulation)) continue;
if (xp.parse_bool("rrsim_detail", rrsim_detail)) continue;
if (xp.parse_bool("sched_op_debug", sched_op_debug)) continue;
if (xp.parse_bool("scrsave_debug", scrsave_debug)) continue;
if (xp.parse_bool("slot_debug", slot_debug)) continue;
if (xp.parse_bool("state_debug", state_debug)) continue;
if (xp.parse_bool("statefile_debug", statefile_debug)) continue;
if (xp.parse_bool("suspend_debug", suspend_debug)) continue;
if (xp.parse_bool("task_debug", task_debug)) continue;
if (xp.parse_bool("time_debug", time_debug)) continue;
if (xp.parse_bool("trickle_debug", trickle_debug)) continue;
if (xp.parse_bool("unparsed_xml", unparsed_xml)) continue;
if (xp.parse_bool("work_fetch_debug", work_fetch_debug)) continue;
xp.skip_unexpected(true, "LOG_FLAGS::parse");
}
return ERR_XML_PARSE;
}
示例12: parse
int RANDOM_PROCESS::parse(XML_PARSER& xp, const char* end_tag) {
while (!xp.get_tag()) {
if (!xp.is_tag) return ERR_XML_PARSE;
if (xp.parse_double("lambda", lambda)) continue;
else if (xp.parse_double("frac", frac)) continue;
else if (xp.match_tag(end_tag)) {
init(frac, lambda);
return 0;
} else {
printf("unrecognized: %s\n", xp.parsed_tag);
return ERR_XML_PARSE;
}
}
return ERR_XML_PARSE;
}
示例13: parse_name
int RESULT::parse_name(XML_PARSER& xp, const char* end_tag) {
strcpy(name, "");
while (!xp.get_tag()) {
if (xp.match_tag(end_tag)) return 0;
if (xp.parse_str("name", name, sizeof(name))) continue;
if (log_flags.unparsed_xml) {
msg_printf(0, MSG_INFO,
"[unparsed_xml] RESULT::parse_name(): unrecognized: %s\n",
xp.parsed_tag
);
}
xp.skip_unexpected();
}
return ERR_XML_PARSE;
}
示例14: 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;
}
示例15: parse
int OTHER_RESULT::parse(XML_PARSER& xp) {
strcpy(name, "");
have_plan_class = false;
app_version = -1;
while (!xp.get_tag()) {
if (xp.match_tag("/other_result")) {
if (!strcmp(name, "")) return ERR_XML_PARSE;
return 0;
}
if (xp.parse_str("name", name, sizeof(name))) continue;
if (xp.parse_int("app_version", app_version)) continue;
if (xp.parse_str("plan_class", plan_class, sizeof(plan_class))) {
have_plan_class = true;
continue;
}
}
return ERR_XML_PARSE;
}