#include "scripting/lua_fileops.hpp"
#include "filesystem.hpp"
#include "log.hpp"
#include "scripting/lua_common.hpp"
#include "scripting/push_check.hpp"
#include "picture.hpp"
#include "sdl/point.hpp"
#include <algorithm>
#include <exception>
#include <string>
Go to the source code of this file.
Classes | |
class | lua_fileops::lua_filestream |
Namespaces | |
lua_fileops | |
Macros | |
#define | DBG_LUA LOG_STREAM(debug, log_scripting_lua) |
#define | LOG_LUA LOG_STREAM(info, log_scripting_lua) |
#define | WRN_LUA LOG_STREAM(warn, log_scripting_lua) |
#define | ERR_LUA LOG_STREAM(err, log_scripting_lua) |
Functions | |
static int | intf_get_image_size (lua_State *L) |
Gets the dimension of an image. More... | |
static int | intf_have_asset (lua_State *L) |
Returns true if an asset with the given path can be found in the binary paths. More... | |
static int | intf_resolve_asset (lua_State *L) |
Given an asset path relative to binary paths, resolves to an absolute asset path starting from data/. More... | |
static std::string | lua_fileops::get_calling_file (lua_State *L) |
static bool | lua_fileops::canonical_path (std::string &filename, const std::string ¤tdir) |
resolves filename to an absolute path More... | |
static bool | lua_fileops::resolve_filename (std::string &filename, const std::string ¤tdir, std::string *rel=nullptr) |
resolves filename to an absolute path More... | |
int | lua_fileops::intf_canonical_path (lua_State *L) |
int | lua_fileops::intf_have_file (lua_State *L) |
Checks if a file exists (not necessarily a Lua script). More... | |
int | lua_fileops::intf_read_file (lua_State *L) |
Reads a file into a string, or a directory into a list of files therein. More... | |
int | lua_fileops::load_file (lua_State *L) |
Loads a Lua file and pushes the contents on the stack. More... | |
int | lua_fileops::luaW_open (lua_State *L) |
Variables | |
static lg::log_domain | log_scripting_lua ("scripting/lua") |
#define DBG_LUA LOG_STREAM(debug, log_scripting_lua) |
Definition at line 30 of file lua_fileops.cpp.
#define ERR_LUA LOG_STREAM(err, log_scripting_lua) |
Definition at line 33 of file lua_fileops.cpp.
#define LOG_LUA LOG_STREAM(info, log_scripting_lua) |
Definition at line 31 of file lua_fileops.cpp.
#define WRN_LUA LOG_STREAM(warn, log_scripting_lua) |
Definition at line 32 of file lua_fileops.cpp.
|
static |
Gets the dimension of an image.
Definition at line 41 of file lua_fileops.cpp.
References image::exists(), image::get_size(), markup::img(), and s.
Referenced by lua_fileops::luaW_open().
|
static |
Returns true if an asset with the given path can be found in the binary paths.
Definition at line 57 of file lua_fileops.cpp.
References filesystem::get_binary_file_location().
Referenced by lua_fileops::luaW_open().
|
static |
Given an asset path relative to binary paths, resolves to an absolute asset path starting from data/.
Definition at line 70 of file lua_fileops.cpp.
References filesystem::get_independent_binary_file_path(), and lua_push().
Referenced by lua_fileops::luaW_open().
|
static |