From 989169545163a7e4db2f25ff844ba420ab679e56 Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Fri, 5 Jun 2009 05:55:59 +0000 Subject: [PATCH] add Lua bindings for GetError and Seek in RageFile --- stepmania/src/RageFile.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/stepmania/src/RageFile.cpp b/stepmania/src/RageFile.cpp index f67e86c27c..cabdb60d0b 100644 --- a/stepmania/src/RageFile.cpp +++ b/stepmania/src/RageFile.cpp @@ -340,6 +340,12 @@ public: return 1; } + static int Seek( T* p, lua_State *L ) + { + lua_pushinteger( L, p->Seek( IArg(1) ) ); + return 1; + } + static int GetLine( T* p, lua_State *L ) { RString string; @@ -354,14 +360,22 @@ public: return 1; } + static int GetError( T* p, lua_State *L ) + { + lua_pushstring( L, p->GetError() ); + return 1; + } + LunaRageFile() { ADD_METHOD( Open ); ADD_METHOD( Close ); ADD_METHOD( Write ); ADD_METHOD( Read ); + ADD_METHOD( Seek ); ADD_METHOD( GetLine ); ADD_METHOD( PutLine ); + ADD_METHOD( GetError ); ADD_METHOD( destroy ); } };