1
0

write shit

This commit is contained in:
2026-01-06 16:27:19 +08:00
parent 52916db08f
commit 4cdc56a32d
24 changed files with 512 additions and 135 deletions

View File

@@ -0,0 +1,37 @@
#include "char_types.hpp"
#include <string_view>
#if defined(BASALT_OS_WINDOWS)
#include <Windows.h>
#else
#endif
namespace Basalt::Shared {
class PipeOperator {
public:
#if defined(BASALT_OS_WINDOWS)
using Handle = HANDLE;
static constexpr Handle BAD_PIPE_HANDLE = INVALID_HANDLE_VALUE;
#else
using Handle = int;
static constexpr Handle BAD_PIPE_HANDLE = -1;
#endif
public:
PipeOperator(const std::basic_string_view<BSCHAR> name);
~PipeOperator();
// Delete copy ctor
PipeOperator(const PipeOperator&) = delete;
PipeOperator& operator=(const PipeOperator&) = delete;
// Implement move ctor
PipeOperator(PipeOperator&&) noexcept;
PipeOperator& operator=(PipeOperator&& other) noexcept;
void Read(void* buffer, size_t size);
void Write(const void* buffer, size_t size);
private:
Handle m_Handle;
};
} // namespace Basalt::Shared