*** empty log message ***

svn path=/trunk/boinc/; revision=2658
This commit is contained in:
Karl Chen 2003-11-11 17:29:31 +00:00
parent 34e0a2f369
commit 9e7d64fb7d
2 changed files with 39 additions and 29 deletions

View File

@ -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

View File

@ -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 <vector>
#include <string>
#include <sstream>
#include <cstring>
#include <cstdio>
#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;" },
{ '!', "&excl;" },
{ '\"', "&quot;" },
{ '\"', "&dquot;" },
@ -74,15 +76,15 @@ const xml_entity xml_trans[]= {
{ '|', "&verbar;" },
{ '}', "&rcub;" },
{ '~', "&tilde;" },
{ 0x82, "&lsquor;" },
{ 0x84, "&ldquor;" },
{ 0x85, "&ldots;" },
{ 0x8a, "&Scaron;" },
{ 0x8b, "&lsaquo;" },
{ 0x8c, "&OElig;" },
{ 0x91, "&lsquo;" },
{ 0x91, "&rsquor;" },
{ 0x92, "&rsquo;" },
{ 0x82, "&lsquor;" },
{ 0x84, "&ldquor;" },
{ 0x85, "&ldots;" },
{ 0x8a, "&Scaron;" },
{ 0x8b, "&lsaquo;" },
{ 0x8c, "&OElig;" },
{ 0x91, "&lsquo;" },
{ 0x91, "&rsquor;" },
{ 0x92, "&rsquo;" },
{ 0x93, "&ldquo;" },
{ 0x93, "&rdquor;" },
{ 0x94, "&rdquo;" },
@ -188,12 +190,12 @@ const xml_entity xml_trans[]= {
{ 0xfe, "&thorn;" },
{ 0xff, "&yuml;" },
{ 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<unsigned char>(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 ***
//