基本思想:随手记录一下rapidJson的存储字符串和空间释放
CMakeLists.txt
cmake_minimum_required(VERSION 3.16)
project(untitled2)
set(CMAKE_CXX_STANDARD 14)
include_directories(${CMAKE_SOURCE_DIR}/include)
find_package(OpenCV REQUIRED)
add_executable(untitled2 main.cpp Base64.cpp)
target_link_libraries(untitled2 ${OpenCV_LIBS})
Base64.h
//
// Created by PHILIPS on 10/27/2021.
//
#ifndef PHOTOTAKE_BASE64_H
#define PHOTOTAKE_BASE64_H
#include <string>
using namespace std;
class Base64 {
public:
Base64();
~Base64();
/*编码
DataByte
[in]输入的数据长度,以字节为单位
*/
std::string Encode(const unsigned char* Data, int DataByte);
/*解码
DataByte
[in]输入的数据长度,以字节为单位
OutByte
[out]输出的数据长度,以字节为单位,请不要通过返回值计算
输出数据的长度
*/