/** \file
* @brief XML quoting routines
*//*
* Authors:
* Krzysztof KosiĆski <tweenk.pl@gmail.com>
*
* This file is in the public domain.
*/
#include <cstring>
#include <glib.h>
/// Returns the length of the string after quoting the characters <code>"&<></code>.
{
if (!val) return 0;
switch (*valp) {
case '"':
break;
case '&':
break;
case '<':
case '>':
break;
default:
++len;
break;
}
}
return len;
}
{
switch(*srcp) {
case '"':
resp += 6;
break;
case '&':
resp += 5;
break;
case '<':
resp += 4;
break;
case '>':
resp += 4;
break;
default:
break;
}
}
*resp = 0;
return result;
}
// quote: ", &, <, >
/*
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 :