Base64: Add raw_ostream and SmallString interfaces. (#19)

This commit is contained in:
Peter Johnson
2017-08-13 00:55:56 -07:00
committed by GitHub
parent 2fa41b23b9
commit 17b5cace5b
3 changed files with 107 additions and 32 deletions

View File

@@ -13,11 +13,28 @@
#include "llvm/StringRef.h"
namespace llvm {
template <typename T>
class SmallVectorImpl;
class raw_ostream;
}
namespace wpi {
std::size_t Base64Decode(llvm::raw_ostream& os, llvm::StringRef encoded);
std::size_t Base64Decode(llvm::StringRef encoded, std::string* plain);
llvm::StringRef Base64Decode(llvm::StringRef encoded, std::size_t* num_read,
llvm::SmallVectorImpl<char>& buf);
void Base64Encode(llvm::raw_ostream& os, llvm::StringRef plain);
void Base64Encode(llvm::StringRef plain, std::string* encoded);
llvm::StringRef Base64Encode(llvm::StringRef plain,
llvm::SmallVectorImpl<char>& buf);
} // namespace wpi
#endif // WPIUTIL_SUPPORT_BASE64_H_