Skip to content

Commit

Permalink
Doc updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheQuinbox committed Nov 24, 2024
1 parent 8b9b544 commit 9f8c05b
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
Determines if a string ends with another string.
bool string::ends_with(string str);
bool string::ends_with(const string&in str);
## Arguments:
* string str: the string to look for.
* const string&in str: the string to look for.
## Returns:
bool: true if the string ends with the specified search, false if not.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
Formats a string with placeholders.
string string::format(const ?& in = null...);
string string::format(const ?&in = null...);
## Arguments:
* const ?& in = null: Any stringable value. You can pass up to 16 parameters.
* const ?&in = null: Any stringable value. You can pass up to 16 parameters.
## Returns:
Returns the formatted string.
## Remarks:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# insert
Insert a string into another string at a given position.

`void string::insert(uint pos, string other);`
`void string::insert(uint pos, const string&in other);`

## Arguments:
* uint pos: the index to insert the other string at.
* string other: the string to insert.
* const string&in other: the string to insert.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# replace
Try to find any occurrences of a particular string, and replace them with a substitution in a given string object.

`string string::replace(string search, string replacement, bool replace_all = true);`
`string string::replace(const string&in search, const string&in replacement, bool replace_all = true);`

## Arguments:
* string search: the string to search for.
* string replacement: the string to replace the search text with (if found).
* const string&in search: the string to search for.
* const string&in replacement: the string to replace the search text with (if found).
* bool replace_all = true: whether or not all occurrences should be replaced, or only the first one.

## Returns:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# replace_this
Try to find any occurrences of a particular string, and replace them with a substitution in a given string object.

`string& string::replace_this(string search, string replacement, bool replace_all = true);`
`string& string::replace_this(const string&in search, const string&in replacement, bool replace_all = true);`

## Arguments:
* string search: the string to search for.
* string replacement: the string to replace the search text with (if found).
* const string&in search: the string to search for.
* const string&in replacement: the string to replace the search text with (if found).
* bool replace_all = true: whether or not all occurrences should be replaced, or only the first one.

## Returns:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
Splits a string into an array at a given delimiter.
string[]@ string::split(string delimiter);
string[]@ string::split(const string&in delimiter);
## Arguments:
* string delimiter: the delimiter to split at.
* const string&in delimiter: the delimiter to split at.
## Returns:
string[]@: a handle to an array containing each part of the split string.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
Determines if a string starts with another string.
bool string::starts_with(string str);
bool string::starts_with(const string&in str);
## Arguments:
* string str: the string to look for.
* const string&in str: the string to look for.
## Returns:
bool: true if the string starts with the specified search, false if not.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# connect
Attempt to establish a connection with a server, only works when set up as a client.

`uint64 network::connect(string hostname, uint16 port);`
`uint64 network::connect(const string&in hostname, uint16 port);`

## Arguments:
* string hostname: the hostname/IP address to connect to.
* const string&in hostname: the hostname/IP address to connect to.
* uint16 port: the port to use.

## Returns:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# send
Attempt to send a packet over the network.

`bool network::send(uint peer_id, string message, uint8 channel, bool reliable = true);`
`bool network::send(uint peer_id, const string&in message, uint8 channel, bool reliable = true);`

## Arguments:
* uint peer_id: the ID of the peer to send to (specify 1 to send to the server from a client).
* string message: the message to send.
* const string&in message: the message to send.
* uint8 channel: the channel to send the message on (see the main networking documentation for more details).
* bool reliable = true: whether or not the packet should be sent reliably or not (see the main networking documentation for more details).

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# send_reliable
Attempt to send a packet over the network reliably.

`bool network::send_reliable(uint peer_id, string message, uint8 channel);`
`bool network::send_reliable(uint peer_id, const string&in message, uint8 channel);`

## Arguments:
* uint peer_id: the ID of the peer to send to (specify 1 to send to the server from a client).
* string message: the message to send.
* const string&in message: the message to send.
* uint8 channel: the channel to send the message on (see the main networking documentation for more details).

## Returns:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# send_unreliable
Attempt to send a packet over the network unreliably.

`bool network::send_unreliable(uint peer_id, string message, uint8 channel);`
`bool network::send_unreliable(uint peer_id, const string&in message, uint8 channel);`

## Arguments:
* uint peer_id: the ID of the peer to send to (specify 1 to send to the server from a client).
* string message: the message to send.
* const string&in message: the message to send.
* uint8 channel: the channel to send the message on (see the main networking documentation for more details).

## Returns:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
Generates a random ascii character.
string random_character(string min_ascii, string max_ascii);
string random_character(const string&in min_ascii, const string&in max_ascii);
## Arguments:
* string min_ascii: the minimum possible ascii character to be generated.
* string max_ascii: the maximum possible ascii character.
* const string&in min_ascii: the minimum possible ascii character to be generated.
* const string&in max_ascii: the maximum possible ascii character.
## Returns:
string: a random ascii character in the given range.
## Remarks:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
Decrypts a string using the AES 256 bit CBC algorithm.
string string_aes_decrypt(string the_data, string the_key)
string string_aes_decrypt(const string&in the_data, const string&in the_key)
## Arguments:
* string the_data: The data to be decrypted.
* string the_key: The key to decrypt the data with.
* const string&in the_data: The data to be decrypted.
* const string&in the_key: The key to decrypt the data with.
## Returns:
string: decrypted text on success or an empty string on failure.
## Remarks:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
Encrypts a string using the AES 256 bit CBC algorithm.
string string_aes_encrypt(string the_data, string the_key)
string string_aes_encrypt(const string&in the_data, const string&in the_key)
## Arguments:
* string the_data: The data to be encrypted.
* string the_key: The key to encrypt the data with.
* const string&in the_data: The data to be encrypted.
* const string&in the_key: The key to encrypt the data with.
## Returns:
string: Encrypted ciphertext on success or an empty string on failure.
## Remarks:
Expand Down

0 comments on commit 9f8c05b

Please sign in to comment.