ARC SDK
Base64.h
1 // -*- indent-tabs-mode: nil -*-
2 
3 // Base64 encoding and decoding
4 
5 #ifndef ARCLIB_BASE64
6 #define ARCLIB_BASE64
7 
8 #include <string>
9 
10 namespace Arc {
11 
13 
15  class Base64 {
16  public:
18  Base64();
19  ~Base64();
21  static std::string encode(const std::string& bufplain);
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.
27  static int encode_len(int len);
29 
30  static int encode(char *encoded, const char *string, int len);
31  static int decode_len(const char *bufcoded);
33 
34  static int decode(char *bufplain, const char *bufcoded);
35  };
36 } // namespace Arc
37 
38 #endif // ARCLIB_BASE64