The Battle for Wesnoth  1.15.2+dev
Classes | Namespaces | Macros | Functions | Variables
lua_fileops.cpp File Reference
#include "scripting/lua_fileops.hpp"
#include "filesystem.hpp"
#include "game_config.hpp"
#include "game_errors.hpp"
#include "log.hpp"
#include "scripting/lua_common.hpp"
#include "scripting/push_check.hpp"
#include <algorithm>
#include <exception>
#include <string>
#include <boost/algorithm/string/predicate.hpp>
#include "lua/lauxlib.h"
#include "lua/lua.h"
#include "lua/luaconf.h"
Include dependency graph for lua_fileops.cpp:

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 std::string lua_fileops::get_calling_file (lua_State *L)
 
static bool lua_fileops::canonical_path (std::string &filename, const std::string &currentdir)
 resolves filename to an absolute path More...
 
static bool lua_fileops::resolve_filename (std::string &filename, const std::string &currentdir, 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...
 

Variables

static lg::log_domain log_scripting_lua ("scripting/lua")
 

Macro Definition Documentation

◆ DBG_LUA

#define DBG_LUA   LOG_STREAM(debug, log_scripting_lua)

Definition at line 35 of file lua_fileops.cpp.

◆ ERR_LUA

#define ERR_LUA   LOG_STREAM(err, log_scripting_lua)

Definition at line 38 of file lua_fileops.cpp.

Referenced by lua_fileops::lua_filestream::lua_read_data().

◆ LOG_LUA

#define LOG_LUA   LOG_STREAM(info, log_scripting_lua)

Definition at line 36 of file lua_fileops.cpp.

Referenced by lua_fileops::lua_filestream::lua_loadfile().

◆ WRN_LUA

#define WRN_LUA   LOG_STREAM(warn, log_scripting_lua)

Definition at line 37 of file lua_fileops.cpp.

Variable Documentation

◆ log_scripting_lua

lg::log_domain log_scripting_lua("scripting/lua")
static