Geogram  Version 1.9.1-rc
A programming library of geometric algorithms
lua_io.h File Reference

LUA bindings for geogram IO and filesystem functions. More...

#include <geogram/api/defs.h>
#include <vector>
#include <string>
#include <geogram/third_party/lua/lua.h>

Go to the source code of this file.

Functions

void init_lua_io (lua_State *L)
 Initializes LUA filesystem operations. More...
 
void register_embedded_lua_file (const char *filename, const char *data)
 Registers an "embedded file", i.e. a static string with some LUA sources in it. More...
 
void get_embedded_lua_file (const char *filename, const char **data)
 Gets an "embedded file" by its filename. More...
 
void list_embedded_lua_files (std::vector< std::string > &filenames)
 Lists the "embedded file" filenames. More...
 

Detailed Description

LUA bindings for geogram IO and filesystem functions.

Definition in file lua_io.h.

Function Documentation

◆ get_embedded_lua_file()

void get_embedded_lua_file ( const char *  filename,
const char **  data 
)

Gets an "embedded file" by its filename.

Parameters
[in]filenamethe name that was previously used to register the file, using register_embedded_file()
[out]dataa pointer to the static string with the "file" data, or nullptr if no file was registered with that name.

◆ init_lua_io()

void init_lua_io ( lua_State *  L)

Initializes LUA filesystem operations.

Parameters
[in]La pointer to the LUA state.

◆ list_embedded_lua_files()

void list_embedded_lua_files ( std::vector< std::string > &  filenames)

Lists the "embedded file" filenames.

Parameters
[out]filenamesa vector with all the filenames that were previously registered using register_embedded_lua_file()

◆ register_embedded_lua_file()

void register_embedded_lua_file ( const char *  filename,
const char *  data 
)

Registers an "embedded file", i.e. a static string with some LUA sources in it.

Parameters
[in]filenamethe name of the "file" to be used to retreive the data.
[in]datathe static string with the sources associated with the file.