Explorar el Código

Rename 'register_user_type' to 'registerUserType'

Ole hace 10 años
padre
commit
35f58bd600
Se han modificado 3 ficheros con 8 adiciones y 8 borrados
  1. 1 1
      examples/usertypes.cpp
  2. 1 1
      lib/luwra/usertypes.hpp
  3. 6 6
      tests/usertypes.cpp

+ 1 - 1
examples/usertypes.cpp

@@ -33,7 +33,7 @@ int main() {
 	// Register our user type.
 	// This function also registers a garbage-collector hook and a string representation function.
 	// Both can be overwritten using the third parameter, which lets you add custom meta methods.
-	luwra::register_user_type<Point>(
+	luwra::registerUserType<Point>(
 		state,
 		// Methods which shall be availabe in the Lua user data, need to be declared here
 		{

+ 1 - 1
lib/luwra/usertypes.hpp

@@ -177,7 +177,7 @@ struct Value<U*> {
  * Meta-methods can be added and/or overwritten aswell.
  */
 template <typename U> static inline
-void register_user_type(
+void registerUserType(
 	State* state,
 	const std::map<const char*, CFunction>& methods = std::map<const char*, CFunction>(),
 	const std::map<const char*, CFunction>& meta_methods = std::map<const char*, CFunction>()

+ 6 - 6
tests/usertypes.cpp

@@ -15,7 +15,7 @@ TEST_CASE("usertypes_registration") {
 	lua_State* state = luaL_newstate();
 
 	// Registration
-	luwra::register_user_type<A>(state);
+	luwra::registerUserType<A>(state);
 
 	// Reference
 	A* instance = new A;
@@ -33,7 +33,7 @@ TEST_CASE("usertypes_ctor") {
 	lua_State* state = luaL_newstate();
 
 	// Registration
-	luwra::register_user_type<A>(state);
+	luwra::registerUserType<A>(state);
 	luwra::setGlobal(state, "A", LUWRA_WRAP_CONSTRUCTOR(A, int));
 
 	// Construction
@@ -65,7 +65,7 @@ TEST_CASE("usertypes_wrap_fields") {
 	lua_State* state = luaL_newstate();
 
 	// Registration
-	luwra::register_user_type<B>(
+	luwra::registerUserType<B>(
 		state,
 		{
 			{"n", LUWRA_WRAP_FIELD(B::n)},
@@ -142,7 +142,7 @@ TEST_CASE("usertypes_wrap_methods") {
 	lua_State* state = luaL_newstate();
 
 	// Registration
-	luwra::register_user_type<C>(
+	luwra::registerUserType<C>(
 		state,
 		{
 			{"foo1", LUWRA_WRAP_METHOD(C::foo1)},
@@ -183,7 +183,7 @@ TEST_CASE("usertypes_gchook_tref") {
 	lua_State* state = luaL_newstate();
 
 	// Registration
-	luwra::register_user_type<std::shared_ptr<int>>(state);
+	luwra::registerUserType<std::shared_ptr<int>>(state);
 
 	// Instantiation
 	std::shared_ptr<int> shared_var = std::make_shared<int>(1337);
@@ -202,7 +202,7 @@ TEST_CASE("usertypes_gchook_tptr") {
 	lua_State* state = luaL_newstate();
 
 	// Registration
-	luwra::register_user_type<std::shared_ptr<int>>(state);
+	luwra::registerUserType<std::shared_ptr<int>>(state);
 
 	// Instantiation
 	std::shared_ptr<int> shared_var = std::make_shared<int>(1337);