ProxyServerTcp / include /accumulator.h
xukc
[feat]proxy framework
83607bc
raw
history blame
484 Bytes
#include <iostream>
#include <vector>
class Accumulator {
public:
void addData(const char* data, size_t size) {
// 将新的数据块追加到累加器
dataBlocks.insert(dataBlocks.end(), data, data + size);
}
size_t getDataSize() const {
return dataBlocks.size();
}
const char* getData() const {
return dataBlocks.data();
}
void clear() {
dataBlocks.clear();
}
private:
std::vector<char> dataBlocks;
};