source: trunk/src/core/RpEncode.h @ 2726

Last change on this file since 2726 was 1451, checked in by gah, 15 years ago
File size: 1.3 KB
Line 
1
2/*
3 * ======================================================================
4 *  Rappture::encoding
5 *
6 *  AUTHOR:  Derrick Kearney, Purdue University
7 *
8 *  Copyright (c) 2004-2007  Purdue Research Foundation
9 * ----------------------------------------------------------------------
10 *  See the file "license.terms" for information on usage and
11 *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
12 * ======================================================================
13 */
14
15#ifndef RP_ENCODE_H
16#define RP_ENCODE_H
17
18#include <RpOutcome.h>
19#include <RpBuffer.h>
20
21namespace Rappture {
22namespace encoding {
23
24enum RapptureEncodingFlags {
25    RPENC_Z  =(1<<0),           /* Compress/Decompress the string. */
26    RPENC_B64=(1<<1),           /* Base64 encode/decode the string. */
27    RPENC_HDR=(1<<2),           /* Placebo. Header is by default added. */
28    RPENC_RAW=(1<<3)            /* Treat the string as raw input.
29                                 * Decode: ignore the header.
30                                 * Encode: don't add a header.
31                                 */
32};
33
34bool isBinary(const char* buf, int size);
35bool isBase64(const char* buf, int size);
36bool isGzipped(const char* buf, int size);
37unsigned int headerFlags(const char* buf, int size);
38bool encode(Rappture::Outcome &err, Rappture::Buffer& buf, unsigned int flags);
39bool decode(Rappture::Outcome &err, Rappture::Buffer& buf, unsigned int flags);
40
41}
42}
43#endif /*RP_ENCODE_H*/
Note: See TracBrowser for help on using the repository browser.