KeyedDecoderGlib.h [plain text]
#ifndef KeyedDecoderGlib_h
#define KeyedDecoderGlib_h
#include "KeyedCoding.h"
#include <glib.h>
#include <wtf/HashMap.h>
#include <wtf/glib/GRefPtr.h>
#include <wtf/text/StringHash.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
class KeyedDecoderGlib final : public KeyedDecoder {
public:
KeyedDecoderGlib(const uint8_t* data, size_t);
~KeyedDecoderGlib() override;
private:
bool decodeBytes(const String& key, const uint8_t*&, size_t&) override;
bool decodeBool(const String& key, bool&) override;
bool decodeUInt32(const String& key, uint32_t&) override;
bool decodeInt32(const String& key, int32_t&) override;
bool decodeInt64(const String& key, int64_t&) override;
bool decodeFloat(const String& key, float&) override;
bool decodeDouble(const String& key, double&) override;
bool decodeString(const String& key, String&) override;
bool beginObject(const String& key) override;
void endObject() override;
bool beginArray(const String& key) override;
bool beginArrayElement() override;
void endArrayElement() override;
void endArray() override;
template<typename T, typename F> bool decodeSimpleValue(const String& key, T& result, F getFunction);
HashMap<String, GRefPtr<GVariant>> dictionaryFromGVariant(GVariant*);
Vector<HashMap<String, GRefPtr<GVariant>>> m_dictionaryStack;
Vector<GVariant*, 16> m_arrayStack;
Vector<unsigned> m_arrayIndexStack;
};
}
#endif // KeyedDecoderGlib_h