org.luaj.vm2.lib.StringLib Java Examples

The following examples show how to use org.luaj.vm2.lib.StringLib. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JsePlatform.java    From VideoOS-Android-SDK with GNU General Public License v3.0 6 votes vote down vote up
/**
     * Create a standard set of globals for JSE including all the libraries.
     *
     * @return Table of globals initialized with the standard JSE libraries
     * @see #debugGlobals()
     * @see JsePlatform
     * @see JmePlatform
     */
    public static Globals standardGlobals(Globals globals) {
        globals.load(new JseBaseLib());
        globals.load(new PackageLib());
        globals.load(new Bit32Lib());
        globals.load(new TableLib());
        globals.load(new StringLib());
        globals.load(new CoroutineLib());
        globals.load(new JseMathLib());
        globals.load(new JseOsLib());
//		globals.load(new JseIoLib());//安全考虑,删除for LuaView
//		globals.load(new LuajavaLib());//安全考虑,删除for LuaView
        LoadState.install(globals);
        LuaC.install(globals);
        return globals;
    }
 
Example #2
Source File: JsePlatform.java    From XPrivacyLua with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Create a standard set of globals for JSE including all the libraries.
 * 
 * @return Table of globals initialized with the standard JSE libraries
 * @see #debugGlobals()
 * @see org.luaj.vm2.lib.jse.JsePlatform
 * @see org.luaj.vm2.lib.jme.JmePlatform
 */
public static Globals standardGlobals() {
	Globals globals = new Globals();
	globals.load(new JseBaseLib());
	globals.load(new PackageLib());
	globals.load(new Bit32Lib());
	globals.load(new TableLib());
	globals.load(new StringLib());
	globals.load(new CoroutineLib());
	globals.load(new JseMathLib());
	globals.load(new JseIoLib());
	globals.load(new JseOsLib());
	globals.load(new LuajavaLib());
	LoadState.install(globals);
	LuaC.install(globals);
	return globals;		
}
 
Example #3
Source File: JmePlatform.java    From luaj with MIT License 6 votes vote down vote up
/**
 * Create a standard set of globals for JME including all the libraries.
 * 
 * @return Table of globals initialized with the standard JME libraries
 * @see #debugGlobals()
 * @see org.luaj.vm2.lib.jse.JsePlatform
 * @see org.luaj.vm2.lib.jme.JmePlatform
 */
public static Globals standardGlobals() {
	Globals globals = new Globals();
	globals.load(new BaseLib());
	globals.load(new PackageLib());
	globals.load(new Bit32Lib());
	globals.load(new OsLib());
	globals.load(new MathLib());
	globals.load(new TableLib());
	globals.load(new StringLib());
	globals.load(new CoroutineLib());
	globals.load(new JmeIoLib());
	LoadState.install(globals);
	LuaC.install(globals);
	return globals;		
}
 
Example #4
Source File: LuaEngine.java    From remixed-dungeon with GNU General Public License v3.0 6 votes vote down vote up
private LuaEngine() {
	globals = new Globals();
	globals.load(new JseBaseLib());
	globals.load(new PackageLib());
	globals.load(new Bit32Lib());
	globals.load(new TableLib());
	globals.load(new StringLib());
	globals.load(new CoroutineLib());
	globals.load(new JseMathLib());
	globals.load(new JseIoLib());
	globals.load(new JseOsLib());
	globals.load(new MultiDexLuajavaLib());
	LoadState.install(globals);
	LuaC.install(globals);

	globals.finder = this;
	globals.set("loadResource", new resLoader());
}
 
Example #5
Source File: JsePlatform.java    From HtmlNative with Apache License 2.0 5 votes vote down vote up
/**
 * Create a standard set of globals for JSE including all the libraries.
 *
 * @return Table of globals initialized with the standard JSE libraries
 * @see #debugGlobals()
 * @see org.luaj.vm2.lib.jse.JsePlatform
 * @see org.luaj.vm2.lib.jme.JmePlatform
 */
public static Globals standardGlobals() {
    Globals globals = new Globals();
    globals.load(new JseBaseLib());
    globals.load(new PackageLib());
    globals.load(new Bit32Lib());
    globals.load(new TableLib());
    globals.load(new StringLib());
    globals.load(new JseMathLib());
    globals.load(new JseOsLib());
    LoadState.install(globals);
    LuaC.install(globals);
    return globals;
}
 
Example #6
Source File: LuaString.java    From VideoOS-Android-SDK with GNU General Public License v3.0 4 votes vote down vote up
public LuaValue get(LuaValue key) {
    return s_metatable != null ? gettable(this, key) : StringLib.instance.get(key);
}
 
Example #7
Source File: MetatableTest.java    From luaj with MIT License 4 votes vote down vote up
protected void setUp() throws Exception {
	// needed for metatable ops to work on strings
	new StringLib();
}