#pragma once

#include <softbus_core/models/DOMMessage.h>
#include <softbus_core/plugin/IFramer.h>

namespace softbus::core {

struct ParseResult {
    bool success{false};
    DOMMessage message;
};

class IParser {
public:
    virtual ~IParser() = default;
    virtual ParseResult parseFrame(const uint8_t* data, std::size_t size, const std::string& sourceId) = 0;
    virtual const char* protocolName() const = 0;
};

extern "C" SOFTBUS_PLUGIN_API IParser* create_parser();
extern "C" SOFTBUS_PLUGIN_API void destroy_parser(IParser* parser);

} // namespace softbus::core
