Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-21 09:30:07

0001 /*
0002 ---------------------------------------------------------------------------
0003 Open Asset Import Library (assimp)
0004 ---------------------------------------------------------------------------
0005 
0006 Copyright (c) 2006-2024, assimp team
0007 
0008 All rights reserved.
0009 
0010 Redistribution and use of this software in source and binary forms,
0011 with or without modification, are permitted provided that the following
0012 conditions are met:
0013 
0014 * Redistributions of source code must retain the above
0015   copyright notice, this list of conditions and the
0016   following disclaimer.
0017 
0018 * Redistributions in binary form must reproduce the above
0019   copyright notice, this list of conditions and the
0020   following disclaimer in the documentation and/or other
0021   materials provided with the distribution.
0022 
0023 * Neither the name of the assimp team, nor the names of its
0024   contributors may be used to endorse or promote products
0025   derived from this software without specific prior
0026   written permission of the assimp team.
0027 
0028 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0029 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0030 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
0031 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
0032 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
0033 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
0034 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
0035 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
0036 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0037 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0038 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0039 ---------------------------------------------------------------------------
0040 */
0041 
0042 #pragma once
0043 #ifndef AI_BASE64_HPP_INC
0044 #define AI_BASE64_HPP_INC
0045 
0046 #include <assimp/defs.h>
0047 
0048 #include <stdint.h>
0049 #include <vector>
0050 #include <string>
0051 
0052 namespace Assimp {
0053 namespace Base64 {
0054 
0055 /// @brief Will encode the given character buffer from UTF64 to ASCII
0056 /// @param in           The UTF-64 buffer.
0057 /// @param inLength     The size of the buffer
0058 /// @param out          The encoded ASCII string.
0059 ASSIMP_API void Encode(const uint8_t *in, size_t inLength, std::string &out);
0060 
0061 /// @brief Will encode the given character buffer from UTF64 to ASCII.
0062 /// @param in   A vector, which contains the buffer for encoding.
0063 /// @param out  The encoded ASCII string.
0064 ASSIMP_API void Encode(const std::vector<uint8_t> &in, std::string &out);
0065 
0066 /// @brief Will encode the given character buffer from UTF64 to ASCII.
0067 /// @param in   A vector, which contains the buffer for encoding.
0068 /// @return The encoded ASCII string.
0069 ASSIMP_API std::string Encode(const std::vector<uint8_t> &in);
0070 
0071 /// @brief Will decode the given character buffer from ASCII to UTF64.
0072 /// @param in           The ASCII buffer to decode.
0073 /// @param inLength     The size of the buffer.
0074 /// @param out          The decoded buffer.
0075 /// @return The new buffer size.
0076 ASSIMP_API size_t Decode(const char *in, size_t inLength, uint8_t *&out);
0077 
0078 /// @brief Will decode the given character buffer from ASCII to UTF64.
0079 /// @param in   The ASCII buffer to decode as a std::string.
0080 /// @param out  The decoded buffer.
0081 /// @return The new buffer size.
0082 ASSIMP_API size_t Decode(const std::string &in, std::vector<uint8_t> &out);
0083 
0084 /// @brief Will decode the given character buffer from ASCII to UTF64.
0085 /// @param in   The ASCII string.
0086 /// @return The decoded buffer in a vector.
0087 ASSIMP_API std::vector<uint8_t> Decode(const std::string &in);
0088 
0089 } // namespace Base64
0090 } // namespace Assimp
0091 
0092 #endif // AI_BASE64_HPP_INC