Files

37 lines
1.2 KiB
C++
Raw Permalink Normal View History

2024-09-07 11:54:38 +02:00
/*
* This file is part of the Flowee project
2025-10-28 12:45:26 +01:00
* Copyright (C) 2016,2018-2025 Tom Zander <tom@flowee.org>
2024-09-07 11:54:38 +02:00
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef StreamingUtils_H
#define StreamingUtils_H
#include <cstdint>
2026-03-04 17:58:05 +01:00
#include <string>
#include <vector>
2024-09-07 11:54:38 +02:00
namespace Streaming
{
int writeCompactSize(char *data, uint64_t value);
2025-10-28 12:45:26 +01:00
/// return the compact size int from a bytearray.
/// Fails on there not being enough bytes available by simply
/// returning zero and setting the data pointer to match \a end.
uint64_t readCompactSize(const char **data, const char *end);
2026-03-04 17:58:05 +01:00
std::string bytesToHex(const std::vector<char> &bytes);
2024-09-07 11:54:38 +02:00
}
#endif