/usr/include/wvstreams/wvbase64.h is in libwvstreams-dev 4.6.1-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | /* -*- Mode: C++ -*-
* Worldvisions Weaver Software:
* Copyright (C) 1997-2002 Net Integration Technologies, Inc.
*
* Base64 encoder and decoder implementations.
*/
#ifndef __WVBASE64_H
#define __WVBASE64_H
#include "wvencoder.h"
/**
* A base 64 encoder.
*
* On finish(), outputs any needed pad characters.
*
* Supports reset().
*
*/
class WvBase64Encoder : public WvEncoder
{
enum State {
ATBIT0, ATBIT2, ATBIT4
};
State state;
unsigned int bits; // remaining bits shifted left 8 bits
public:
/** Creates a base 64 encoder. */
WvBase64Encoder();
virtual ~WvBase64Encoder() { }
protected:
// on flush, outputs any needed pad characters
virtual bool _encode(WvBuf &in, WvBuf &out, bool flush);
virtual bool _finish(WvBuf &out);
virtual bool _reset(); // supported
};
/**
* A base 64 decoder.
*
* Becomes isfinished() == true on detection of padding.
*
* Supports reset().
*
*/
class WvBase64Decoder : public WvEncoder
{
enum State {
ATBIT0, ATBIT2, ATBIT4, ATBIT6, PAD
};
State state;
unsigned int bits; // remaining bits shifted left 6 bits
public:
/** Creates a base 64 decoder. */
WvBase64Decoder();
virtual ~WvBase64Decoder() { }
protected:
virtual bool _encode(WvBuf &in, WvBuf &out, bool flush);
virtual bool _reset(); // supported
};
#endif // __WVBASE64_H
|