-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Documentation of audio_form and token_gen (#82)
* Documentation of audio_form and token_gen * Documentation for Token Gen has been updated, including its enum constants. * Audio Form documentation: `set_enable_go_to_index`, and `set_disallowed_chars`. * Update and rename token_gen_flag {.md to token_gen_flag.md
- Loading branch information
Showing
5 changed files
with
45 additions
and
4 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
...y User Interface (form.nvgt)/Classes/audio_form/Methods/set_disallowed_chars.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# set_disallowed_chars | ||
Sets the whitelist/blacklist characters of a control. | ||
|
||
`bool audio_form::set_disallowed_chars(int control_index, string chars, bool use_only_disallowed_chars = false, string char_disallowed_description = "");` | ||
|
||
## Arguments: | ||
* int control_index: the index of the control. | ||
* string chars: the characters to set. | ||
* bool use_only_disallowed_chars = false: sets whether the control should only use the characters in this list. true means use only characters that are in the list, and false means allow only characters that are not in the list. | ||
* string char_disallowed_description = "": the text to speak when an invalid character is inputted. | ||
|
||
## Returns: | ||
bool: true if the characters were successfully set, false otherwise. | ||
|
||
## Remarks: | ||
Setting the use_only_disallowed_chars parameter to true will restrict all characters that are not in the list. This is useful to prevent other characters in number inputs. | ||
|
||
Setting the chars parameter to blank will clear the characters and will switch back to default. |
11 changes: 11 additions & 0 deletions
11
...User Interface (form.nvgt)/Classes/audio_form/Methods/set_enable_go_to_index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# set_enable_go_to_index | ||
Toggles whether the control can use go to line functionality. | ||
|
||
`bool audio_form::set_enable_go_to_index(int control_index, bool enabled);` | ||
|
||
## Arguments: | ||
* int control_index: the index of the control. | ||
* bool enabled: enables the go to line functionality. | ||
|
||
## Returns: | ||
bool: true if the state was successfully set, false otherwise. |
2 changes: 1 addition & 1 deletion
2
doc/src/references/include/Token Generation (token_gen.nvgt)/!token_gen.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# Token generation include | ||
Allows you to easily generate random strings of characters of any length. | ||
Allows you to easily generate random strings of characters of any length in a given mode. |
9 changes: 9 additions & 0 deletions
9
...rc/references/include/Token Generation (token_gen.nvgt)/Enums/token_gen_flag.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# token_gen_flag | ||
This enum holds various constants that can be passed to the mode parameter in order to change how tokens are generated. | ||
|
||
* token_gen_flag_all: Uses all characters, numbers and symbols, see below. | ||
* token_gen_flag_characters: Uses only characters, a-z, A-Z | ||
* token_gen_flag_numbers: Uses only numbers, 0-9 | ||
* token_gen_flag_symbols: Uses only symbols, \`\~\!\@\#\$\%\^\&\*\(\)\_\+\=\-\[\]\{\}\/\.\,\;\:\|\?\>\<\ | ||
* token_gen_flag_numbers_symbols: Uses numbers and symbols. | ||
* token_gen_flag_characters_symbols: Uses characters and symbols. |
9 changes: 6 additions & 3 deletions
9
doc/src/references/include/Token Generation (token_gen.nvgt)/Functions/generate_token.nvgt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
/** | ||
Generates a string of random characters, or token. | ||
string generate_token(int token_length) | ||
string generate_token(int token_length, int mode = token_gen_flag_all) | ||
## Arguments: | ||
* int token_length: the length of the token to generate. | ||
* int mode = token_gen_flag_all: the mode to generate. | ||
## returns: | ||
String: a random token. | ||
String: a random token depending on the mode. | ||
## Remarks: | ||
The characters used to generate the token are: "1234567890abcdefthijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ". | ||
The characters used to generate the token will depend on the mode you set. See `token_gen_flags` enum constants. | ||
*/ | ||
|
||
// Example: | ||
#include "token_gen.nvgt" | ||
|
||
void main() { | ||
alert("Info", "Your token is: " + generate_token(10)); | ||
alert("Info", "Numbers only token is: " + generate_token(10, token_gen_flag_numbers)); | ||
alert("Info", "Characters only token is: " + generate_token(10, token_gen_flag_characters)); | ||
} |