new cspot/bell

This commit is contained in:
philippe44
2023-05-06 23:50:26 +02:00
parent e0e7e718ba
commit 8bad480112
163 changed files with 6611 additions and 6739 deletions

View File

@@ -1,10 +1,9 @@
#pragma once
#include <string>
#include <stdexcept>
#include <BellLogger.h>
#include <ByteStream.h>
#include <stdio.h>
#include <ByteStream.h> // for ByteStream
#include <stdint.h> // for uint8_t
#include <stdio.h> // for size_t, FILE
#include <string> // for string
/*
* FileStream
@@ -12,17 +11,15 @@
* A class for reading and writing to files implementing the ByteStream interface.
*
*/
namespace bell
{
class FileStream : public ByteStream
{
public:
FileStream(const std::string& path, std::string mode);
~FileStream();
namespace bell {
class FileStream : public ByteStream {
public:
FileStream(const std::string& path, std::string mode);
~FileStream();
FILE* file;
FILE* file;
/*
/*
* Reads data from the stream.
*
* @param buf The buffer to read data into.
@@ -30,18 +27,18 @@ namespace bell
* @return The number of bytes read.
* @throws std::runtime_error if the stream is closed.
*/
size_t read(uint8_t *buf, size_t nbytes);
size_t read(uint8_t* buf, size_t nbytes);
/*
/*
* Skips nbytes bytes in the stream.
*/
size_t skip(size_t nbytes);
size_t skip(size_t nbytes);
size_t position();
size_t position();
size_t size();
size_t size();
// Closes the connection
void close();
};
}
// Closes the connection
void close();
};
} // namespace bell