#pragma once
#include <Windows.h>
#include <string>

class ClipboardOperations
{
public:
    static HGLOBAL AllocateMemory(size_t size);
    static void FreeMemory(HGLOBAL hMem);

    static void* LockMemory(HGLOBAL hMem);
    static bool UnlockMemory(HGLOBAL hMem);

    static size_t GetMemorySize(HGLOBAL hMem);
    static bool IsMemoryValid(HGLOBAL hMem);

    static bool CopyToMemory(HGLOBAL hMem, const void* data, size_t size);
    static bool CopyFromMemory(void* dest, HGLOBAL hMem, size_t size);

    static HGLOBAL CreateTextData(const std::wstring& text);
    static std::wstring ExtractTextData(HGLOBAL hData);

private:
    static size_t CalculateTextSize(const std::wstring& text);
};