1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-28 03:52:23 -05:00

Documentation/Web: Web documentation by ``Echo_''!

This commit is contained in:
Merlijn Wajer 2011-03-13 20:45:25 +01:00
parent 230b825388
commit 73b479b7c9

View File

@ -11,6 +11,7 @@ OpenWebPage
procedure OpenWebPage(const url : string); procedure OpenWebPage(const url : string);
OpenWebPage opens the given web page (url) with your default browser.
GetPage GetPage
~~~~~~~ ~~~~~~~
@ -19,6 +20,8 @@ GetPage
function GetPage(const url : string): string; function GetPage(const url : string): string;
GetPage returns a string of HTML from the given web page.
InitializeHTTPClient InitializeHTTPClient
~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
@ -27,6 +30,8 @@ InitializeHTTPClient
function InitializeHTTPClient(HandleCookies: Boolean): Integer; function InitializeHTTPClient(HandleCookies: Boolean): Integer;
InitializeHTTPClient creates a new client and assigns it an ID. You use this for
all the other web functions that require a client.
InitializeHTTPClientWrap InitializeHTTPClientWrap
~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
@ -35,6 +40,8 @@ InitializeHTTPClientWrap
function InitializeHTTPClientWrap(HandleCookies: Boolean): Integer; function InitializeHTTPClientWrap(HandleCookies: Boolean): Integer;
This should probably not be documented.
FreeHTTPClient FreeHTTPClient
~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
@ -43,6 +50,7 @@ FreeHTTPClient
procedure FreeHTTPClient(Client: Integer); procedure FreeHTTPClient(Client: Integer);
Free the HTTP client returned by *InitializeHTTPClient*.
GetHTTPPage GetHTTPPage
~~~~~~~~~~~ ~~~~~~~~~~~
@ -51,6 +59,9 @@ GetHTTPPage
function GetHTTPPage(Client: Integer;const URL: string): string; function GetHTTPPage(Client: Integer;const URL: string): string;
GetHTTPPage is just like GetPage, except you can choose which client to get the
HTTP code from.
SetHTTPUserAgent SetHTTPUserAgent
~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
@ -59,6 +70,7 @@ SetHTTPUserAgent
procedure SetHTTPUserAgent(Client: Integer;const Agent: string); procedure SetHTTPUserAgent(Client: Integer;const Agent: string);
SetHTTPUserAgent allows you to change the agent string of a client.
PostHTTPPage PostHTTPPage
~~~~~~~~~~~~ ~~~~~~~~~~~~
@ -67,6 +79,8 @@ PostHTTPPage
function PostHTTPPage(Client: Integer;const Url,PostData: string): string; function PostHTTPPage(Client: Integer;const Url,PostData: string): string;
PostHTTPPage requests to post data (PostData) on the web page (Url) of the
client (Client).
PostHTTPPageEx PostHTTPPageEx
~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
@ -75,6 +89,8 @@ PostHTTPPageEx
function PostHTTPPageEx(Client: Integer;const Url: string): string; function PostHTTPPageEx(Client: Integer;const Url: string): string;
PostHTTPPageEx is just like PostHTTPPage but uses predefined post data added by
ddPostVariable and cleared by ClearPostData.
ClearPostData ClearPostData
~~~~~~~~~~~~~ ~~~~~~~~~~~~~
@ -83,6 +99,9 @@ ClearPostData
procedure ClearPostData(Client: Integer); procedure ClearPostData(Client: Integer);
ClearPostData clears the post data added to the web page (Client). Used with
PostHTTPPageEx.
AddPostVariable AddPostVariable
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
@ -91,6 +110,8 @@ AddPostVariable
procedure AddPostVariable(Client: Integer;const VarName, VarValue: string); procedure AddPostVariable(Client: Integer;const VarName, VarValue: string);
AddPostVariable adds a post variable to the web page (Client). Used with
PostHTTPPageEx.
GetRawHeaders GetRawHeaders
~~~~~~~~~~~~~ ~~~~~~~~~~~~~
@ -99,6 +120,8 @@ GetRawHeaders
function GetRawHeaders(Client: Integer): string; function GetRawHeaders(Client: Integer): string;
GetRawHeaders returns a string of headers from the specified client.
SetProxy SetProxy
~~~~~~~~ ~~~~~~~~
@ -107,6 +130,8 @@ SetProxy
procedure SetProxy(Client : Integer; pHost, pPort : String);'); procedure SetProxy(Client : Integer; pHost, pPort : String);');
SetProxy configures a proxy with the given client (Client) proxy host (pHost)
and port (pPort).
CreateSocket CreateSocket
~~~~~~~~~~~~ ~~~~~~~~~~~~
@ -115,6 +140,7 @@ CreateSocket
function CreateSocket: integer; function CreateSocket: integer;
CreateSocket creates a new socket and assigns it an ID.
FreeSocket FreeSocket
~~~~~~~~~~ ~~~~~~~~~~
@ -123,6 +149,7 @@ FreeSocket
procedure FreeSocket(Index: integer); procedure FreeSocket(Index: integer);
FreeSocket frees the socket with the ID (Index) assigned to it upon creation.
ConnectSocket ConnectSocket
~~~~~~~~~~~~~ ~~~~~~~~~~~~~
@ -131,6 +158,9 @@ ConnectSocket
procedure ConnectSocket(Client: integer; IP, Port: string); procedure ConnectSocket(Client: integer; IP, Port: string);
ConnectSocket connects the socket to an IP and port on the specified client
(Client).
BindSocket BindSocket
~~~~~~~~~~ ~~~~~~~~~~
@ -139,6 +169,8 @@ BindSocket
procedure BindSocket(Client: integer; IP, Port: string); procedure BindSocket(Client: integer; IP, Port: string);
BindSocket binds a connected socket to an IP and port on the specified client
(Client).
ListenSocket ListenSocket
~~~~~~~~~~~~ ~~~~~~~~~~~~
@ -147,6 +179,8 @@ ListenSocket
procedure ListenSocket(Client: integer); procedure ListenSocket(Client: integer);
ListenSocket allows for a client socket to accept connections.
AcceptSocket AcceptSocket
~~~~~~~~~~~~ ~~~~~~~~~~~~
@ -155,6 +189,8 @@ AcceptSocket
function AcceptSocket(Client: integer): integer; function AcceptSocket(Client: integer): integer;
AcceptSocket accepts pending connection requests to a client socket.
CloseSocket CloseSocket
~~~~~~~~~~~ ~~~~~~~~~~~
@ -163,6 +199,8 @@ CloseSocket
procedure CloseSocket(Client: integer); procedure CloseSocket(Client: integer);
CloseSocket closes connections to a client socket.
RecvSocket RecvSocket
~~~~~~~~~~ ~~~~~~~~~~
@ -170,6 +208,7 @@ RecvSocket
function RecvSocket(Client: integer): string; function RecvSocket(Client: integer): string;
RecvSocket method reads all data waiting for read.
RecvSocketStr RecvSocketStr
~~~~~~~~~~~~~ ~~~~~~~~~~~~~
@ -178,13 +217,18 @@ RecvSocketStr
function RecvSocketStr(Client: integer): string; function RecvSocketStr(Client: integer): string;
Method waits until data string is received. This string is terminated by CR-LF
characters. The resulting string is returned without this termination (CR-LF)
RecvSocketEx RecvSocketEx
~~~~~~~~~~~~ ~~~~~~~~~~~~
.. code-block:: pascal .. code-block:: pascal
unction RecvSocketEx(Client, Length: integer): string; function RecvSocketEx(Client, Length: integer): string;
RecvSocketEx returns received data of a specified length from a bound socket as
a string.
SendSocket SendSocket
@ -194,6 +238,7 @@ SendSocket
procedure SendSocket(Client: integer; Data: string); procedure SendSocket(Client: integer; Data: string);
SendSocket sends a string of data to a bound client socket.
SetTimeout SetTimeout
~~~~~~~~~~ ~~~~~~~~~~
@ -202,6 +247,8 @@ SetTimeout
procedure SetTimeout(Client, Time: integer); procedure SetTimeout(Client, Time: integer);
SetTimeout sets a maximum amount of time for a bound client socket to wait for
data from another socket.
SocketInfo SocketInfo
~~~~~~~~~~ ~~~~~~~~~~
@ -210,4 +257,4 @@ SocketInfo
procedure SocketInfo(Client: integer; out IP, Port: string); procedure SocketInfo(Client: integer; out IP, Port: string);
SocketInfo sets where a bound socket will be sending data to (out IP, out Port).