quote.cpp revision 578e86fa9a9074f7904482204fabc4a50316edcb
/** \file
* XML quoting routines.
*/
/* Based on Lauris' repr_quote_write in repr-io.cpp.
*
* Copyright (C) 1999-2002 Lauris Kaplinski
* Copyright (C) 2004 Monash University
*
* of the GNU General Public License: see the file `COPYING'.
*/
#include <cstring>
#include <glib.h>
#include "quote.h"
/** \return strlen(xml_quote_strdup(\a val)) (without doing the malloc).
* \pre val != NULL
*/
xml_quoted_strlen(char const *val)
{
switch (*val) {
default: ++ret; break;
}
}
}
return ret;
}
/** Writes \a src (including the NUL byte) to \a dest, doing XML quoting as necessary.
*
* \pre \a src != NULL.
* \pre \a dest must have enough space for (xml_quoted_strlen(src) + 1) bytes.
*/
static void
{
} while(0)
switch (*src) {
}
}
*dest = '\0';
}
/** \return A g_malloc'd buffer containing an XML-quoted version of \a src.
* \pre src != NULL.
*/
char *
xml_quote_strdup(char const *src)
{
return ret;
}
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :