Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
1 /*
2 * Copyright 2006 The Android Open Source Project
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
8 #ifndef SkBase64_DEFINED
9 #define SkBase64_DEFINED
11 #include "SkTypes.h"
13 struct SkBase64 {
14 public:
15 enum Error {
16 kNoError,
17 kPadError,
18 kBadCharError
19 };
21 SkBase64();
22 Error decode(const char* src, size_t length);
23 char* getData() { return fData; }
24 /**
25 Base64 encodes src into dst. encode is a pointer to at least 65 chars.
26 encode[64] will be used as the pad character. Encodings other than the
27 default encoding cannot be decoded.
28 */
29 static size_t Encode(const void* src, size_t length, void* dest, const char* encode = NULL);
31 private:
32 Error decode(const void* srcPtr, size_t length, bool writeDestination);
34 size_t fLength;
35 char* fData;
36 friend class SkImageBaseBitmap;
37 };
39 #endif // SkBase64_DEFINED