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

Last change on this file since 1366 was 1366, checked in by gah, 14 years ago

Begin reorganizing Rappture C++ API, starting with the use of
Rappture::Outcome.

Instead of returning an Outcome and expecting every routine to
save it, pass it as a reference. Let's strip it down to what's
needed right now and add back functionality as required.

Right now too many return values are ignored in the rappture library.
We need to check all results and return the error messages via
the Outcome. At the topmost level where is touches the developer
API we can drop the error checking or turn it on via an environment
variable.

Example. Not enough checks are made for memory allocation failure.
If the application is running on an over-committed server memory
allocation errors will be silently passed on. It's okay to be
fault tolerant where possible, but if we fail to check in the internal
library functions, it's too late.

--gah

File size: 992 bytes
Line 
1/*
2 * ======================================================================
3 *  Rappture::encoding
4 *
5 *  AUTHOR:  Derrick Kearney, Purdue University
6 *
7 *  Copyright (c) 2004-2007  Purdue Research Foundation
8 * ----------------------------------------------------------------------
9 *  See the file "license.terms" for information on usage and
10 *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
11 * ======================================================================
12 */
13
14#ifndef RAPPTURE_ENCODE_H
15#define RAPPTURE_ENCODE_H
16
17#include <RpOutcome.h>
18#include <RpBuffer.h>
19
20namespace Rappture {
21namespace encoding {
22
23#define RPENC_Z      (1<<0)
24#define RPENC_B64    (1<<1)
25#define RPENC_HDR    (1<<2)
26
27int isbinary(const char* buf, int size);
28size_t isencoded(const char* buf, int size);
29bool encode(Rappture::Outcome &err, Rappture::Buffer& buf, size_t flags);
30bool decode(Rappture::Outcome &err, Rappture::Buffer& buf, size_t flags);
31
32}
33}
34#endif // RAPPTURE_ENCODE_H
Note: See TracBrowser for help on using the repository browser.