source: trunk/src/core/RpEncode.h

Last change on this file was 5673, checked in by ldelgass, 9 years ago

Fix line endings, set eol-style to native on all C/C++ sources.

  • Property svn:eol-style set to native
File size: 1.3 KB
RevLine 
[1384]1
[671]2/*
3 * ======================================================================
4 *  Rappture::encoding
5 *
6 *  AUTHOR:  Derrick Kearney, Purdue University
7 *
[3177]8 *  Copyright (c) 2004-2012  HUBzero Foundation, LLC
[671]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
[1384]15#ifndef RP_ENCODE_H
16#define RP_ENCODE_H
[671]17
[1366]18#include <RpOutcome.h>
[1030]19#include <RpBuffer.h>
[671]20
21namespace Rappture {
[1366]22namespace encoding {
[671]23
[1384]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};
[1366]33
[1384]34bool isBinary(const char* buf, int size);
35bool isBase64(const char* buf, int size);
[1451]36bool isGzipped(const char* buf, int size);
[1382]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);
[671]40
[1366]41}
42}
[1384]43#endif /*RP_ENCODE_H*/
Note: See TracBrowser for help on using the repository browser.