From 9e7d64fb7d60b5a28868e9e1aaa434581dacfe73 Mon Sep 17 00:00:00 2001 From: Karl Chen Date: Tue, 11 Nov 2003 17:29:31 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=2658 --- checkin_notes | 5 ++++ lib/xml_util.C | 63 +++++++++++++++++++++++++++----------------------- 2 files changed, 39 insertions(+), 29 deletions(-) diff --git a/checkin_notes b/checkin_notes index e3ff3b49d4..6c9a8ab946 100755 --- a/checkin_notes +++ b/checkin_notes @@ -7667,3 +7667,8 @@ David 9 Nov 2003 David 10 Nov 2003 - released versions of Astropulse (2.10) and SETI@home (2.08) for Windows. + +Karl 2003-11-11 + - compile fixes + lib/ + xml_util.C diff --git a/lib/xml_util.C b/lib/xml_util.C index 5f9f3b08ef..c72354517e 100644 --- a/lib/xml_util.C +++ b/lib/xml_util.C @@ -3,18 +3,18 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // #include "config.h" @@ -22,6 +22,8 @@ #include #include #include +#include +#include #include "xml_util.h" int xml_indent_level=0; @@ -38,7 +40,7 @@ const xml_entity xml_trans[]= { { 0x07, "&bel;" }, { 0x0a, "&lf;" }, { 0x0d, "&cr;" }, - { ' ', "&sp;" }, + { ' ', "&sp;" }, { '!', "!" }, { '\"', """ }, { '\"', "&dquot;" }, @@ -74,15 +76,15 @@ const xml_entity xml_trans[]= { { '|', "|" }, { '}', "}" }, { '~', "˜" }, - { 0x82, "‚" }, - { 0x84, "„" }, - { 0x85, "&ldots;" }, - { 0x8a, "Š" }, - { 0x8b, "‹" }, - { 0x8c, "Œ" }, - { 0x91, "‘" }, - { 0x91, "’" }, - { 0x92, "’" }, + { 0x82, "‚" }, + { 0x84, "„" }, + { 0x85, "&ldots;" }, + { 0x8a, "Š" }, + { 0x8b, "‹" }, + { 0x8c, "Œ" }, + { 0x91, "‘" }, + { 0x91, "’" }, + { 0x92, "’" }, { 0x93, "“" }, { 0x93, "”" }, { 0x94, "”" }, @@ -188,12 +190,12 @@ const xml_entity xml_trans[]= { { 0xfe, "þ" }, { 0xff, "ÿ" }, { 0x00, 0 } -}; +}; #if 0 xml_ofstream::xml_ofstream() : my_tag(), os() {} -xml_ofstream::xml_ofstream(const char *filename, const char *tag, +xml_ofstream::xml_ofstream(const char *filename, const char *tag, std::ios_base::openmode m) : , my_tag(tag), os(filename,m) { if (is_open()) { @@ -201,8 +203,8 @@ xml_ofstream::xml_ofstream(const char *filename, const char *tag, } } -xml_ostream::xml_ostream(std::ostream &o, const char *tag) - : my_tag(tag), os(o) +xml_ostream::xml_ostream(std::ostream &o, const char *tag) + : my_tag(tag), os(o) { write_head(); } @@ -215,7 +217,7 @@ xml_ofstream::~xml_ofstream() { close(); } -void xml_ofstream::open(const char *filename, const char *tag, +void xml_ofstream::open(const char *filename, const char *tag, std::ios_base::openmode m) { my_tag=std::string(tag); os.open(filename,m); @@ -256,7 +258,7 @@ void xml_ofstream::write_foot() { xml_ifstream::xml_ifstream() : , my_tag(""), xml_start(0), ifs() xml_end(0) {} -xml_ifstream::xml_ifstream(const char *filename, const char *tag, +xml_ifstream::xml_ifstream(const char *filename, const char *tag, std::ios_base::openmode m) : std::ifstream(filename,m), my_tag(tag), xml_start(0), xml_end(0) { if (is_open()) { @@ -264,7 +266,7 @@ xml_ifstream::xml_ifstream(const char *filename, const char *tag, } } -xml_istream::xml_istream(std::istream &i, const char *tag) +xml_istream::xml_istream(std::istream &i, const char *tag) : my_tag(tag), is(i) { } @@ -272,7 +274,7 @@ xml_ifstream::~xml_ifstream() { close(); } -void xml_ifstream::open(const char *filename, const char *tag, +void xml_ifstream::open(const char *filename, const char *tag, std::ios_base::openmode m) { my_tag=std::string(tag); std::ifstream::open(filename,m); @@ -363,7 +365,7 @@ void xml_ifstream::seek_head() { std::ifstream::seekg(tag_end-tmp.size(),std::ios::cur); xml_end=std::ifstream::tellg(); } - } + } if (xml_start) std::ifstream::seekg(xml_start,std::ios::beg); } @@ -390,7 +392,7 @@ xml_ifstream &xml_ifstream::seekg(off_type o, std::ios::seekdir d) { std::ios::pos_type xml_ifstream::tellg() { return std::ifstream::tellg()-xml_start; } - + bool xml_ifstream::eof() { if (std::ifstream::tellg() >= xml_end) { return true; @@ -496,7 +498,7 @@ std::string encode_char(unsigned char c) { #endif return std::string(buf); } -} +} unsigned char decode_char(const char *s) { char code[32]; @@ -533,7 +535,7 @@ unsigned char decode_char(const char *s) { } return static_cast(i&0xff); } -} +} std::string x_csv_encode_char(const unsigned char *bin, size_t nelements) { std::ostringstream rv(""); @@ -554,6 +556,9 @@ std::string x_csv_encode_char(const unsigned char *bin, size_t nelements) { // // $Log$ +// Revision 1.24 2003/11/11 17:29:01 quarl +// *** empty log message *** +// // Revision 1.23 2003/10/29 20:08:49 korpela // *** empty log message *** //