mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=2581
This commit is contained in:
parent
a3b1428d18
commit
5694205384
|
@ -24,7 +24,6 @@
|
|||
#include <sstream>
|
||||
#include "xml_util.h"
|
||||
|
||||
static const int XML_MAX_INDENT=40;
|
||||
int xml_indent_level=0;
|
||||
|
||||
std::string xml_indent(int i) {
|
||||
|
@ -32,7 +31,6 @@ std::string xml_indent(int i) {
|
|||
xml_indent_level = (xml_indent_level>0) ? xml_indent_level : 0;
|
||||
return std::string(std::min(xml_indent_level,XML_MAX_INDENT),' ');
|
||||
}
|
||||
|
||||
// Most of these entries are for reverse translation of poorly written HTML.
|
||||
// Forward translation doesn't translate most printable characters.
|
||||
|
||||
|
@ -544,7 +542,7 @@ std::string x_csv_encode_char(const unsigned char *bin, size_t nelements) {
|
|||
for (i=0;i<(nelements-1);i++) {
|
||||
unsigned int ival=bin[i];
|
||||
rv << ival << ',';
|
||||
if ((rv.str().size()-lastlen-xml_indent_level)>73) {
|
||||
if ((rv.str().size()-lastlen-std::min(xml_indent_level,XML_MAX_INDENT))>73) {
|
||||
rv << std::endl << xml_indent();
|
||||
lastlen=rv.str().size();
|
||||
}
|
||||
|
@ -556,6 +554,9 @@ std::string x_csv_encode_char(const unsigned char *bin, size_t nelements) {
|
|||
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.21 2003/10/27 20:07:11 korpela
|
||||
// *** empty log message ***
|
||||
//
|
||||
// Revision 1.20 2003/10/27 19:41:23 korpela
|
||||
//
|
||||
// Fixed potential buffer overrun in decode_char()
|
||||
|
|
|
@ -162,6 +162,7 @@ struct xml_entity {
|
|||
// "i" spaces. return a string of spaces corresponding to the current xml
|
||||
// indent level.
|
||||
std::string xml_indent(int i=0);
|
||||
static const int XML_MAX_INDENT=40;
|
||||
extern int xml_indent_level;
|
||||
|
||||
|
||||
|
@ -522,7 +523,7 @@ std::string x_csv_encode(const T *bin, size_t nelements) {
|
|||
if (ischar) return x_csv_encode_char((const unsigned char *)bin, nelements);
|
||||
for (i=0;i<(nelements-1);i++) {
|
||||
rv << bin[i] << ',';
|
||||
if ((rv.str().size()-lastlen-xml_indent_level)>73) {
|
||||
if ((rv.str().size()-lastlen-std::min(xml_indent_level,XML_MAX_INDENT))>73) {
|
||||
rv << std::endl << xml_indent();
|
||||
lastlen=rv.str().size();
|
||||
}
|
||||
|
@ -820,6 +821,9 @@ std::string xml_encode_string(const T *input,
|
|||
#endif
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.14 2003/10/27 20:07:12 korpela
|
||||
// *** empty log message ***
|
||||
//
|
||||
// Revision 1.13 2003/10/25 18:20:03 korpela
|
||||
// *** empty log message ***
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue