[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 | |
---|
| 21 | namespace Rappture { |
---|
[1366] | 22 | namespace encoding { |
---|
[671] | 23 | |
---|
[1384] | 24 | enum 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] | 34 | bool isBinary(const char* buf, int size); |
---|
| 35 | bool isBase64(const char* buf, int size); |
---|
[1451] | 36 | bool isGzipped(const char* buf, int size); |
---|
[1382] | 37 | unsigned int headerFlags(const char* buf, int size); |
---|
| 38 | bool encode(Rappture::Outcome &err, Rappture::Buffer& buf, unsigned int flags); |
---|
| 39 | bool decode(Rappture::Outcome &err, Rappture::Buffer& buf, unsigned int flags); |
---|
[671] | 40 | |
---|
[1366] | 41 | } |
---|
| 42 | } |
---|
[1384] | 43 | #endif /*RP_ENCODE_H*/ |
---|