The Battle for Wesnoth  1.19.5+dev
Namespaces | Functions
lua_stringx.cpp File Reference
#include "scripting/lua_stringx.hpp"
#include "scripting/lua_kernel_base.hpp"
#include "scripting/lua_common.hpp"
#include "scripting/push_check.hpp"
#include "formula/string_utils.hpp"
#include "variable.hpp"
#include <boost/algorithm/string/trim.hpp>
Include dependency graph for lua_stringx.cpp:

Go to the source code of this file.

Namespaces

 lua_stringx
 

Functions

static int lua_stringx::intf_format (lua_State *L)
 Formats a message by interpolating WML variable syntax Arg 1: (optional) Logger Arg 2: Message. More...
 
template<bool conjunct>
static int lua_stringx::intf_format_list (lua_State *L)
 Formats a list into human-readable format Arg 1: default value, used if the list is empty Arg 2: list of strings. More...
 
static int lua_stringx::impl_str_index (lua_State *L)
 Enables indexing a string by an integer, while also treating the stringx module as its metatable.__index. More...
 
static int lua_stringx::intf_str_split (lua_State *L)
 Splits a string into parts according to options Arg 1: String to split Arg 2: Separator Arg 3: Options table. More...
 
static int lua_stringx::intf_str_paren_split (lua_State *L)
 Splits a string into parenthesized portions and portions between parenthesized portions Arg 1: String to split Arg 2: Possible left parentheses Arg 3: Matching right parentheses. More...
 
static int lua_stringx::intf_str_map_split (lua_State *L)
 Splits a string into a map Arg 1: string to split Arg 2: Separator for items Arg 3: Separator for key and value. More...
 
static int lua_stringx::intf_str_join (lua_State *L)
 Joins a list into a string; calls __tostring and __index metamethods Arg 1: list to join Arg 2: separator (arguments can be swapped) More...
 
static int lua_stringx::intf_str_join_map (lua_State *L)
 Joins a map into a string; calls __tostring metamethods (on both key and value) but not __index Arg 1: list to join Arg 2: separator for items Arg 3: separator for key and value (list argument can be swapped to any position) More...
 
static int lua_stringx::intf_str_trim (lua_State *L)
 Trims whitespace from the beginning and end of a string. More...
 
static int lua_stringx::intf_str_format (lua_State *L)
 
static int lua_stringx::intf_parse_range (lua_State *L)
 Parses a range string of the form a-b into an interval pair Accepts the string "infinity" as representing a Very Large Number Arg 2: (optional) If true, parse as real numbers instead of integers. More...
 
int lua_stringx::luaW_open (lua_State *L)