Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
Base64.hGo to the documentation of this file.00001 #ifndef INCLUDED_Base64_H 00002 #define INCLUDED_Base64_H 00003 /*! @file 00004 * @brief Describes base64 namespace, which holds some functions for encoding and decoding base64 data 00005 * C_Base64 - a simple base64 encoder and decoder. 00006 * 00007 * Copyright (c) 1999, Bob Withers - bwit@pobox.com 00008 * 00009 * This code may be freely used for any purpose, either personal 00010 * or commercial, provided the authors copyright notice remains 00011 * intact. 00012 * 00013 * Modified by Ethan Tira-Thompson: 00014 * - changed Base64 class to base64 namespace 00015 * - modified functions to work on char[] instead of strings 00016 * - added doxygen comments to header 00017 * 00018 * @author Bob Withers - bwit@pobox.com (Creator) 00019 * 00020 * $Author: ejt $ 00021 * $Name: tekkotsu-2_4_1 $ 00022 * $Revision: 1.3 $ 00023 * $State: Exp $ 00024 * $Date: 2005/08/07 04:11:03 $ 00025 */ 00026 00027 #include <string> 00028 00029 //! holds some functions for encoding and decoding base64 data 00030 namespace base64 00031 { 00032 00033 //! returns a string containing the base64 encoding of @a len bytes from @a buf 00034 std::string encode(char buf[], unsigned int len); 00035 00036 //! returns a pointer to a newly allocated region contained the binary data decoded from @a data 00037 /*! If @a data is malformed @c NULL will be returned */ 00038 char* decode(const std::string& data); 00039 00040 //! returns the number of bytes which will be decoded from @a data 00041 /*! Does not check data for correctness, just counts the fill 00042 * characters at the end of the string */ 00043 unsigned int decodeSize(const std::string& data); 00044 00045 //! decodes @a data into @a buf, which you need to provide the size of in @a len 00046 /*! If @a buf is not large enough or @a data is malformed, @c false 00047 * will be returned; otherwise @c true */ 00048 bool decode(const std::string& data, char buf[], unsigned int len); 00049 } 00050 00051 00052 #endif |
Tekkotsu v2.4.1 |
Generated Tue Aug 16 16:32:46 2005 by Doxygen 1.4.4 |