The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Functions
lua_fileops Namespace Reference

Classes

class  lua_filestream
 

Functions

static bool resolve_filename (std::string &filename, const std::string &currentdir)
 resolves filename where currentdir is the current directory, note that currentdir is no absolute directory More...
 
int intf_have_file (lua_State *L)
 Checks if a file exists (not necessarily a Lua script). More...
 
int intf_read_file (lua_State *L)
 Checks if a file exists (not necessarily a Lua script). More...
 
int load_file (lua_State *L)
 Loads a Lua file and pushes the contents on the stack. More...
 

Function Documentation

int lua_fileops::intf_have_file ( lua_State L)

Checks if a file exists (not necessarily a Lua script).

  • Arg 1: string containing the file name.
  • Ret 1: boolean

Definition at line 95 of file lua_fileops.cpp.

References filesystem::get_wml_location(), lua_pushboolean(), and luaL_checkstring.

Referenced by lua_kernel_base::lua_kernel_base().

int lua_fileops::intf_read_file ( lua_State L)
int lua_fileops::load_file ( lua_State L)
static bool lua_fileops::resolve_filename ( std::string filename,
const std::string currentdir 
)
static

resolves filename where currentdir is the current directory, note that currentdir is no absolute directory

Returns
true iff the filename was sucesful resolved.

Definition at line 45 of file lua_fileops.cpp.

References gui2::event::find(), and pos.

Referenced by intf_read_file(), and load_file().