~ubuntu-branches/ubuntu/trusty/nordugrid-arc/trusty-proposed

« back to all changes in this revision

Viewing changes to src/hed/libs/common/Base64.h

  • Committer: Package Import Robot
  • Author(s): Mattias Ellert
  • Date: 2013-05-08 13:48:03 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20130508134803-mrhc5w4d5y7ubyj4
Tags: 3.0.1-1
3.0.1 Release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// -*- indent-tabs-mode: nil -*-
2
2
 
3
 
/* Base64 encoding and decoding, borrowed from Axis2c project.
4
 
 * Below is the license which is required by Axis2c.
5
 
 */
6
 
 
7
 
/*
8
 
 *   Copyright 2003-2004 The Apache Software Foundation.
9
 
 *
10
 
 *   Licensed under the Apache License, Version 2.0 (the "License");
11
 
 *   you may not use this file except in compliance with the License.
12
 
 *   You may obtain a copy of the License at
13
 
 *
14
 
 *       http://www.apache.org/licenses/LICENSE-2.0
15
 
 *
16
 
 *   Unless required by applicable law or agreed to in writing, software
17
 
 *   distributed under the License is distributed on an "AS IS" BASIS,
18
 
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
 
 *   See the License for the specific language governing permissions and
20
 
 *   limitations under the License.
21
 
 */
 
3
// Base64 encoding and decoding
22
4
 
23
5
#ifndef ARCLIB_BASE64
24
6
#define ARCLIB_BASE64
27
9
 
28
10
namespace Arc {
29
11
 
30
 
  /// Base64 encoding and decoding, borrowed from Axis2c project.
 
12
  /// Base64 encoding and decoding.
31
13
  /** \ingroup common
32
14
   *  \headerfile Base64.h arc/Base64.h */
33
15
  class Base64 {
35
17
    /// Constructor is not implemented. Use static methods instead.
36
18
    Base64();
37
19
    ~Base64();
 
20
    /// Encode a string to base 64
 
21
    static std::string encode(const std::string& bufplain);
 
22
    /// Decode a string from base 64
 
23
    static std::string decode(const std::string& bufcoded);
 
24
 
 
25
    // The next 4 methods are legacy API kept for backwards compatibility. They
 
26
    // can be removed in the next major version.
38
27
    static int encode_len(int len);
39
28
    /// Encode a string to base 64
 
29
    /** \deprecated Use encode(std::string&) instead */
40
30
    static int encode(char *encoded, const char *string, int len);
41
31
    static int decode_len(const char *bufcoded);
42
32
    /// Decode a string from base 64
 
33
    /** \deprecated Use decode(std::string&) instead */
43
34
    static int decode(char *bufplain, const char *bufcoded);
44
35
  };
45
36
} // namespace Arc