From a232ab3876cef2791d8fa1e4ebfd3eafa9de22ef Mon Sep 17 00:00:00 2001 From: Eris Lund <38136789+0x5066@users.noreply.github.com> Date: Fri, 9 Jul 2021 07:31:05 +0200 Subject: [PATCH] String search, getting/setting private strings/ints and more... --- .../webamp-modern-2/src/skin/SystemObject.ts | 447 ++++++++++++++++++ 1 file changed, 447 insertions(+) diff --git a/packages/webamp-modern-2/src/skin/SystemObject.ts b/packages/webamp-modern-2/src/skin/SystemObject.ts index 663766e8..df396240 100644 --- a/packages/webamp-modern-2/src/skin/SystemObject.ts +++ b/packages/webamp-modern-2/src/skin/SystemObject.ts @@ -261,6 +261,136 @@ export default class SystemObject extends BaseObject { // TODO } + /** + * strmid() + * + * Get a substring from a string. + * + * @ret The substring. + * @param str The string. + * @param start The start position. + * @param len The length of the string to extract, from start position. + */ + strmid(str: string, start: number, len: number) { + // TODO + } + + /** + * strleft() + * + * Get a substring from a string, starting from the left. + * + * @ret The substring. + * @param str The string. + * @param nchars The length of the string to extract, from the left. + */ + strleft(str: string, nchars: number) { + // TODO + } + + /** + * strright() + * + * Get a substring from a string, starting from the right. Since + * the start point is the right of the string (or the end). It will + * extract the string starting from the END going towards the BEGINNING. + * + * @ret The substring. + * @param str The string. + * @param nchars The length of the string to extract, from the right. + */ + strright(str: string, nchars: number) { + // TODO + } + + /** + * strsearch() + * + * Search a string for any occurance of substring. If the substring was + * found in the string, it will return the position of the substring in + * the string searched. If the substring is not found, the return value + * is -1. + * + * @ret Position at which the substring was found. + * @param str The string to search in. + * @param substr The substring to find. + */ + strsearch(str: string, substr: string) { + // TODO + } + + /** + * Int + * strlen() + * + * Returns the length of the string. + * + * @ret The length of the string. + * @param str The string. + */ + strlen(str: string) { + // TODO + } + + /** + * strupper() + * + * Convert a string to all uppercase. + * + * @ret The uppercase string. + * @param str The string to uppercase. + */ + strupper(str: string) { + // TODO + } + + /** + * strlower() + * + * Convert a string to all lowercase. + * + * @ret The lowercase string. + * @param str The string to lowercase. + */ + strlower(str: string) { + // TODO + } + + /** + * urlEncode() + * + * URL Encode a string. Characters that are NOT encoded + * are: All letters, All digits, underscore (_), dash (-) and + * period (.). + * + * @ret The URL encoded string. + * @param url The string to URL encode. + */ + urlencode(url: string) { + // TODO + } + + /** + * Requires 5.54 + * @param url + */ + urldecode(url: string) { + // TODO + } + + /** + * setPrivateString() + * + * Create a private config entry for your script, of String type. + * + * @param section The section for the entry. + * @param item The item name for the entry. + * @param value The value of the entry. + */ + setprivatestring(section: string, item: string, value: string) { + // TODO + } + /** * Create a private config entry for your script, of Int type. * @@ -272,6 +402,92 @@ export default class SystemObject extends BaseObject { PRIVATE_CONFIG.setPrivateInt(section, item, value); } + /** + * getPrivateString() + * + * Read a private config entry of String type. Returns + * the specified default value if the section and item isn't + * found. + * + * @ret The value of the config entry. + * @param section The section from which to read the entry. + * @param item The name of the item to read. + * @param defvalue The default value to return if no item is found. + */ + getprivatestring(section: string, item: string, defvalue: string) { + // TODO + } + + setpublicstring(item: string, value: string) { + // TODO + } + + /** + * setPublicInt() + * + * Create a public config entry for your script, of Int type. + * + * @param item The item name of the entry. + * @param value The value of the entry. + */ + setpublicint(item: string, value: number) { + // TODO + } + + /** + * getPublicString() + * + * Read a public config entry of String type. Returns + * the specified default value if the item isn't found. + * + * @ret The value of the config entry. + * @param item The item name to read. + * @param defvalue The default value to return if no item is found. + */ + getpublicstring(item: string, defvalue: string) { + // TODO + } + + /** + * Int + * getPublicInt() + * + * Read a public config entry of Integer type. Returns + * the specified default value if the item isn't found. + * + * @ret The value of the config entry. + * @param item The item name to read. + * @param defvalue The default value to return if no item is found. + */ + getpublicint(item: string, defvalue: number) { + // TODO + } + + /** + * getParam() + * + * Get the parameters with which the script is called. + * This is the 'param="..."' attribute in the