code format
This commit is contained in:
@@ -5,32 +5,31 @@
|
||||
* \~russian Программа Lua
|
||||
*/
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
PILuaProgram
|
||||
Andrey Bychkov work.a.b@yandex.ru
|
||||
PIP - Platform Independent Primitives
|
||||
PILuaProgram
|
||||
Andrey Bychkov work.a.b@yandex.ru
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef PILUAPROGRAM_H
|
||||
#define PILUAPROGRAM_H
|
||||
|
||||
#include "pip_lua_export.h"
|
||||
#include "pip_lua.h"
|
||||
#include "pip_lua_export.h"
|
||||
|
||||
class PIP_LUA_EXPORT PILuaProgram
|
||||
{
|
||||
class PIP_LUA_EXPORT PILuaProgram {
|
||||
public:
|
||||
//! Constructs an empty PILuaProgram, initialize Lua context
|
||||
PILuaProgram();
|
||||
|
||||
@@ -5,22 +5,22 @@
|
||||
* \~russian Преобразования между типами PIP и LuaBridge
|
||||
*/
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
PIP Lua bindings
|
||||
Andrey Bychkov work.a.b@yandex.ru
|
||||
PIP - Platform Independent Primitives
|
||||
PIP Lua bindings
|
||||
Andrey Bychkov work.a.b@yandex.ru
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
//! \defgroup Lua Lua
|
||||
//! \~\brief
|
||||
@@ -58,34 +58,31 @@
|
||||
#define PIP_LUA_H
|
||||
|
||||
#include "lua.hpp"
|
||||
#include <LuaBridge/LuaBridge.h>
|
||||
#include "pistring.h"
|
||||
|
||||
#include <LuaBridge/LuaBridge.h>
|
||||
|
||||
namespace luabridge {
|
||||
|
||||
template <>
|
||||
struct Stack <PIString> {
|
||||
static void push (lua_State* L, PIString const& str) {
|
||||
lua_pushstring(L, str.dataUTF8());
|
||||
}
|
||||
template<>
|
||||
struct Stack<PIString> {
|
||||
static void push(lua_State * L, PIString const & str) { lua_pushstring(L, str.dataUTF8()); }
|
||||
|
||||
static PIString get (lua_State* L, int index) {
|
||||
static PIString get(lua_State * L, int index) {
|
||||
if (lua_type(L, index) == LUA_TSTRING) {
|
||||
const char* str = lua_tostring(L, index);
|
||||
const char * str = lua_tostring(L, index);
|
||||
return PIString::fromUTF8(str);
|
||||
}
|
||||
|
||||
lua_pushvalue(L, index);
|
||||
const char* str = lua_tostring(L, -1);
|
||||
const char * str = lua_tostring(L, -1);
|
||||
PIString string = PIString::fromUTF8(str);
|
||||
lua_pop(L, 1);
|
||||
return string;
|
||||
}
|
||||
|
||||
static bool isInstance (lua_State* L, int index) {
|
||||
return lua_type(L, index) == LUA_TSTRING;
|
||||
}
|
||||
static bool isInstance(lua_State * L, int index) { return lua_type(L, index) == LUA_TSTRING; }
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace luabridge
|
||||
#endif // PIP_LUA_H
|
||||
|
||||
Reference in New Issue
Block a user