source: trunk/src/core/RpEntityRef.h @ 1386

Last change on this file since 1386 was 788, checked in by dkearney, 17 years ago

adjustments to entity references encoding to include the length of the string to encode and decode.
this is used for the python bindings, so we can know the length of the string being returned and allow embedded nulls.

File size: 1.4 KB
Line 
1/*
2 * ----------------------------------------------------------------------
3 *  Rappture Library Entity Reference Translation Header
4 *
5 *  Begin Character Entity Translator
6 *
7 *  The next section of code implements routines used to translate
8 *  character entity references into their corresponding strings.
9 *
10 *  Examples:
11 *
12 *        &          "&"
13 *        &lt;           "<"
14 *        &gt;           ">"
15 *        &nbsp;         " "
16 *
17 *
18 * ======================================================================
19 *  AUTHOR:  Derrick Kearney, Purdue University
20 *  Copyright (c) 2004-2007  Purdue Research Foundation
21 *
22 *  See the file "license.terms" for information on usage and
23 *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
24 *
25 *  Also see below text for additional information on usage and redistribution
26 *
27 * ======================================================================
28 */
29
30#ifndef _RpENTITYREF_H
31#define _RpENTITYREF_H
32
33#include "RpBuffer.h"
34
35#ifdef __cplusplus
36    extern "C" {
37#endif // ifdef __cplusplus
38
39namespace Rappture {
40
41class EntityRef
42{
43    public:
44        const char* encode (const char* in, unsigned int len);
45        const char* decode (const char* in, unsigned int len);
46        int size();
47
48        EntityRef () {};
49
50        ~EntityRef() {};
51
52    private:
53        Buffer _bout;
54};
55
56} // namespace Rappture
57
58#ifdef __cplusplus
59    } // extern c
60#endif // ifdef __cplusplus
61
62#endif
Note: See TracBrowser for help on using the repository browser.