From: Kim Nguyễn Date: Fri, 12 Oct 2012 14:39:37 +0000 (+0200) Subject: Remove old commented-out version of the printing code. X-Git-Url: http://git.nguyen.vg/gitweb/?p=SXSI%2FXMLTree.git;a=commitdiff_plain;h=b944271a53c5df8a3530bee8feb40d074f92818b Remove old commented-out version of the printing code. --- diff --git a/xml-tree.cpp b/xml-tree.cpp index 0e597e3..d051212 100644 --- a/xml-tree.cpp +++ b/xml-tree.cpp @@ -596,97 +596,6 @@ void xml_tree::print(xml_tree::node_t x, int fd, bool no_text) } -// void xml_tree::print(xml_tree::node_t x, int fd, bool no_text) -// { -// if (print_buffer == 0) { -// print_buffer = new std::string(BUFFER_SIZE, 0); -// print_buffer->clear(); -// print_stack = new std::vector(); -// print_stack->reserve(256); -// }; - -// xml_tree::node_t fin = bp_find_close(par, x); -// xml_tree::node_t n = x; -// xml_tree::tag_t label = tag(n); -// unsigned char * current_text; - - -// while (n <= fin) { - -// if (bp_inspect(par, n)) { -// if (label == xml_tree::PCDATA_OPEN_TAG_ID){ -// if (no_text) { -// uputs("<$/>", fd); -// } else { -// current_text = get_text(text_id(n)); -// uprintf( (const char*) (current_text + (current_text[0] == 1)), fd); - -// if (current_text && text_index_type != TextCollectionBuilder::index_type_default) -// text_collection->DeleteText(current_text); - -// n += 2; // skip closin $ -// label = tag(n); -// }; -// } else { -// uputc('<', fd); -// uput_str((*tag_names)[label], fd); -// n++; -// if (bp_inspect(par, n)) { -// print_stack->push_back((*tag_names)[label]); -// label = tag(n); -// if (label == xml_tree::ATTRIBUTE_OPEN_TAG_ID) { -// n++; -// if (no_text) uputs("><@@>", fd); - -// while (bp_inspect(par, n)) -// if (no_text) { -// uputc('<', fd); -// uputs((const char*) &(get_tag_name_by_ref(tag(n))[3]), fd); -// uputc('>', fd); -// uputs("<$@/>', fd); -// n += 4; -// } else { -// uputc(' ', fd); -// uputs((const char*) &(get_tag_name_by_ref(tag(n))[3]), fd); -// n+= 2; -// uputs("=\"", fd); -// current_text = get_text(text_id(n)); -// uprintf((const char*) (current_text + (current_text[0] == 1)), fd); -// if (current_text && text_index_type != TextCollectionBuilder::index_type_default) -// text_collection->DeleteText(current_text); -// uputc('"', fd); -// n += 2; -// }; - -// if (no_text) -// uputs("", fd); -// else uputc('>', fd); -// n++; -// label = tag(n); -// } else -// uputc('>', fd); -// } else { -// uputs("/>", fd); -// n++; -// label = tag(n); -// }; -// }; -// } else do { -// uputs("back(), fd); -// uputc('>', fd); -// print_stack->pop_back(); -// n++; -// } while (!bp_inspect(par, n) && !print_stack->empty()); -// label = tag(n); -// }; -// uputc('\n', fd); - -// } - - static inline uchar * next_char(uchar *s, size_t &numtexts) {