AngelscriptDebuggerServer/src/ASVariableFormatter.hpp

23 lines
1.3 KiB
C++

#ifndef ANGELSCRIPTDEBUGGER_ASVARIABLEFORMATTER_HPP
#define ANGELSCRIPTDEBUGGER_ASVARIABLEFORMATTER_HPP
#include <angelscript.h>
#include <nlohmann/json.hpp>
#include "AngelscriptDebugger.hpp"
#include "DebugAdapterProtocol/Types.hpp"
class ASVariableFormatter {
public:
static nlohmann::json GetAsJsonValue(asIScriptEngine* engine, int, void*, int32_t depth = 0);
static DebugAdapterProtocol::Variable GetAsDAPVariable(asIScriptEngine* engine, asIScriptContext* ctx,
AngelscriptDebugger* debugger, const std::string& name, int,
void*);
template <typename T, int (asIScriptContext::*SetArg)(asUINT, T), T (asIScriptContext::*GetLength)()>
static void FormatArrayLike(std::vector<DebugAdapterProtocol::Variable>& vars, asIScriptEngine* engine,
asIScriptContext* ctx, void* address, AngelscriptDebugger* debugger,
asIScriptFunction* indexFunc);
static void GetChildDAPVariables(std::vector<DebugAdapterProtocol::Variable>&, asIScriptEngine* engine,
asIScriptContext* ctx, AngelscriptDebugger* debugger, int, void*);
};
#endif // ANGELSCRIPTDEBUGGER_ASVARIABLEFORMATTER_HPP