Skip to content

Commit

Permalink
Add console API
Browse files Browse the repository at this point in the history
  • Loading branch information
kodeyeen committed Jun 23, 2024
1 parent 83926df commit 679f1ac
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ add_library(${PROJECT_NAME} SHARED
"api/Checkpoint.cpp"
"api/Class.cpp"
"api/Config.cpp"
"api/Console.cpp"
"api/CustomModel.cpp"
"api/GangZone.cpp"
"api/Menu.cpp"
Expand Down
23 changes: 23 additions & 0 deletions api/Console.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include <iostream>

#include "api.hpp"
#include "Gomponent.hpp"

#ifdef __cplusplus
extern "C"
{
#endif

GOMPONENT_EXPORT void console_send(String command)
{
IConsoleComponent* console = Gomponent::Get()->console;

if (console)
{
console->send(StringView(command.buf, command.length));
}
}

#ifdef __cplusplus
}
#endif

0 comments on commit 679f1ac

Please sign in to comment.