unflutter/dart/dart.h
2022-11-27 12:49:38 +03:00

41 lines
815 B
C++

//
// Created by selim on 21.11.22.
//
#ifndef UNFLUTTER_DART_H
#define UNFLUTTER_DART_H
#include <cstdint>
#include <array>
#include <string>
const uint32_t DART_MAGIC = 0xDCDCF5F5;
const char* vmInstructions = "_kDartVmSnapshotInstructions";
const char* vmData = "_kDartVmSnapshotData";
const char* isolateInstructions = "_kDartIsolateSnapshotInstructions";
const char* isolateData = "_kDartIsolateSnapshotData";
const char* buildId = "_kDartSnapshotBuildId";
enum SnapshotKind: uint64_t {
FULL,
FULL_JIT,
FULL_AOT,
MESSAGE,
NONE,
INVALID
};
#pragma pack (1)
struct SnapshotHeader {
uint32_t magic;
int64_t size;
SnapshotKind kind;
std::array<char8_t, 32> versionHash;
};
#pragma pack ()
std::string snapshotKindString(SnapshotKind kind);
#endif //UNFLUTTER_DART_H