Base64Utilities.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
9 
10 #include <Bentley/WString.h>
11 #include <Bentley/bvector.h>
12 
14 
15 /*--------------------------------------------------------------------------------------+
16 * @bsiclass Bentley Systems
17 +---------------+---------------+---------------+---------------+---------------+------*/
19  {
20 private:
22  ~Base64Utilities();
23 
24 public:
25  static Utf8String Encode(Utf8StringCR stringToEncode) { return Encode(stringToEncode.c_str(), stringToEncode.size()); }
26  BENTLEYDLL_EXPORT static Utf8String Encode (Utf8CP bytesToEncode, size_t byteCount);
27  BENTLEYDLL_EXPORT static BentleyStatus Encode(Utf8StringR encodedString, Byte const* bytesToEncode, size_t byteCount);
28 
29  static BentleyStatus Decode(bvector<Byte>& byteArray, Utf8StringCR encodedString) { return Decode(byteArray, encodedString.c_str(), encodedString.size()); }
30  BENTLEYDLL_EXPORT static BentleyStatus Decode(bvector<Byte>& byteArray, Utf8CP encodedString, size_t encodedStringLength);
31 
32  static Utf8String Decode(Utf8StringCR encodedString) { return Decode(encodedString.c_str(), encodedString.size()); }
33  BENTLEYDLL_EXPORT static Utf8String Decode(Utf8CP encodedString, size_t encodedStringLength);
34 
35  BENTLEYDLL_EXPORT static Utf8StringCR Alphabet();
36 
37  BENTLEYDLL_EXPORT static bool MatchesAlphabet(Utf8CP input);
38  };
39 
Contains a UTF-8 encoded string.
Definition: WString.h:275
#define BENTLEYDLL_EXPORT
Definition: Bentley.h:249
static BentleyStatus Decode(bvector< Byte > &byteArray, Utf8StringCR encodedString)
Definition: Base64Utilities.h:29
struct Bentley::Utf8String const & Utf8StringCR
Definition: Bentley.h:241
static Utf8String Encode(Utf8StringCR stringToEncode)
Definition: Base64Utilities.h:25
#define BEGIN_BENTLEY_NAMESPACE
Definition: Bentley.r.h:24
BentleyStatus
Definition: Bentley.h:208
Utf8Char const * Utf8CP
Definition: Bentley.h:229
#define END_BENTLEY_NAMESPACE
Definition: Bentley.r.h:25
unsigned char Byte
Definition: Bentley.r.h:143
Definition: Base64Utilities.h:18
static Utf8String Decode(Utf8StringCR encodedString)
Definition: Base64Utilities.h:32

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.