merged AI doc, some new pages

This commit is contained in:
2026-03-12 14:46:57 +03:00
parent 07ae277f9e
commit ed13838237
206 changed files with 14088 additions and 5152 deletions

View File

@@ -1,9 +1,8 @@
/*! \file piluaprogram.h
* \ingroup Lua
* \~\brief
* \~english Lua Program
* \~russian Программа Lua
*/
//! \~\file piluaprogram.h
//! \~\ingroup Lua
//! \~\brief
//! \~english Lua Program
//! \~russian Программа Lua
/*
PIP - Platform Independent Primitives
PILuaProgram
@@ -29,21 +28,33 @@
#include "pip_lua.h"
#include "pip_lua_export.h"
//! \~\ingroup Lua
//! \~\brief
//! \~english Helper object for loading scripts and exposing the embedded Lua state through LuaBridge.
//! \~russian Вспомогательный объект для загрузки скриптов и доступа к встроенному состоянию Lua через LuaBridge.
//! \details
//! \~english Provides interface for loading and executing Lua scripts using LuaBridge
//! \~russian Предоставляет интерфейс для загрузки и выполнения скриптов Lua с использованием LuaBridge
class PIP_LUA_EXPORT PILuaProgram {
public:
//! Constructs an empty PILuaProgram, initialize Lua context
//! \~english Constructs a Lua program object and opens the standard Lua libraries.
//! \~russian Создает объект Lua-программы и открывает стандартные библиотеки Lua.
PILuaProgram();
//! Load Lua script from PIString
//! \~english Loads and executes Lua source code from \a script.
//! \~russian Загружает и выполняет исходный код Lua из \a script.
bool load(const PIString & script);
//! Execute script
//! \~english Calls \c lua_pcall() for the current Lua stack state.
//! \~russian Вызывает \c lua_pcall() для текущего состояния стека Lua.
bool prepare();
//! Get Lua Object or Function
//! \~english Returns a global Lua value by name.
//! \~russian Возвращает глобальное значение Lua по имени.
luabridge::LuaRef getGlobal(const PIString & name);
//! Return Lua global namespace
//! \~english Returns the LuaBridge namespace bound to the global Lua table.
//! \~russian Возвращает пространство имен LuaBridge, связанное с глобальной таблицей Lua.
luabridge::Namespace getGlobalNamespace();
private:

View File

@@ -40,7 +40,7 @@
//! \~russian \par Общее
//!
//! \~english
//! These files provides execute Lua programs inside C++ code.
//! These files provide execution of Lua programs inside C++ code.
//!
//! \~russian
//! Эти файлы обеспечивают возможность выполнения программ Lua внутри C++ кода.
@@ -64,10 +64,18 @@
namespace luabridge {
//! \~\ingroup Lua
//! \~\brief
//! \~english LuaBridge stack adapter for %PIString.
//! \~russian Адаптер стека LuaBridge для %PIString.
template<>
struct Stack<PIString> {
//! \~english Pushes a UTF-8 representation of the string onto the Lua stack.
//! \~russian Помещает UTF-8 представление строки в стек Lua.
static void push(lua_State * L, PIString const & str) { lua_pushstring(L, str.dataUTF8()); }
//! \~english Reads a Lua value as %PIString, converting non-string values through Lua.
//! \~russian Читает значение Lua как %PIString, при необходимости преобразуя нестроковые значения средствами Lua.
static PIString get(lua_State * L, int index) {
if (lua_type(L, index) == LUA_TSTRING) {
const char * str = lua_tostring(L, index);
@@ -81,6 +89,8 @@ struct Stack<PIString> {
return string;
}
//! \~english Returns whether the value at \a index is already a Lua string.
//! \~russian Возвращает, является ли значение по \a index уже строкой Lua.
static bool isInstance(lua_State * L, int index) { return lua_type(L, index) == LUA_TSTRING; }
};