Skip to content

Commit

Permalink
Add more comments to HTTP.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Mm2PL committed Jun 17, 2024
1 parent 65ff6b7 commit 3cb61ef
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/controllers/plugins/api/HTTP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,15 @@ class HTTPRequest : public std::enable_shared_from_this<HTTPRequest>
*
* If the object given is not a userdatum or the pointer inside that
* userdatum doesn't point to a HTTPRequest, a lua error is thrown.
*
* This function always returns a non-null pointer.
*/
static std::shared_ptr<HTTPRequest> getOrError(lua_State *L,
StackIdx where = -1);
/**
* Pushes the private table onto the lua stack
* Pushes the private table onto the lua stack.
*
* This might create it if it doesn't exist.
*/
StackIdx pushPrivate(lua_State *L);

Expand All @@ -65,6 +69,11 @@ class HTTPRequest : public std::enable_shared_from_this<HTTPRequest>
bool done = false;

public:
// These functions are wrapped so data can be accessed more easily. When a call from Lua comes in:
// - the static wrapper function is called
// - it calls getOrError
// - and then the wrapped method

/**
* Sets the success callback
*
Expand Down

0 comments on commit 3cb61ef

Please sign in to comment.