![]() |
Uptooda Scripting API
|
Namespace containing functions and classes available in squirrel scripts. More...
Classes | |
| class | CWebBrowser |
| class | Document |
| class | FileUploadTaskWrapper |
| class | HtmlDocument |
| class | HtmlElement |
| class | Process |
| The Process class is used to start external programs and to communicate with them. More... | |
| class | CRegExp |
| class | UploadTaskUnion |
| class | UploadTaskWrapper |
| class | UrlShorteningTaskWrapper |
| class | WebServer |
| Start a web server listening a port on 127.0.0.1. More... | |
Functions | |
| string | AnsiToUtf8 (string str, int codepage) |
| string | AskUserCaptcha (INetworkClient *nm, string url) |
| Shows the captcha input dialog. | |
| string | Base64Decode (string data) |
| string | Base64Encode (string data) |
| bool | CopyFile (string source, string destination, bool overwrite) |
| bool | CreateDirectory (string path_, unsigned int mode) |
| void | DebugMessage (string msg, bool isResponseBody) |
| Shows a dialog box with a diagnostic message. | |
| bool | DeleteFile (string utf8Filename) |
| string | ExtractFileName (string path) |
| string | ExtractFileNameNoExt (string fileName) |
| string | ExtractFilePath (string fileName) |
| bool | FileExists (string fileName) |
| string | GenerateRandomFilename (string path, int suffixLen) |
| string | GetAppLanguage () |
| string | GetAppLanguageFile () |
| string | GetAppLocale () |
| table | GetAppVersion () |
| string | GetCurrentThreadId () |
| string | GetDeviceId () |
| string | GetDeviceName () |
| string | GetEnvDecode (string name) |
| string | GetFileContents (string filename) |
| string | GetFileContentsEx (string filename, SQInteger offset, SQInteger size, bool allowPartialRead) |
| string | GetFileExtension (string path) |
| string | GetFileMimeType (string filename) |
| int | GetFileSize (string filename) |
| double | GetFileSizeDouble (string filename) |
| table | GetImageInfo (string fileName) |
| string | GetScriptsDirectory () |
| string | GetTempDirectory () |
| string | hmac_sha1 (string key, string data, bool base64) |
| string | HmacSha1 (string key, string data, bool base64) |
| string | HtmlEntitiesDecode (string src) |
| object | include (string filename) |
| string | InputDialog (string text, string defaultValue) |
| string | JsonEscapeString (string src) |
| string | Md5 (string data) |
| Calculates the md5 hash of a string. | |
| string | md5 (string data) |
| Calculates the md5 hash of a string. | |
| string | md5_file (string filename) |
| Calculates the md5 hash of a given file. | |
| string | Md5Crypt (string password, string salt) |
| Calculates the hash using MD5-Crypt algorythm. Similar to the 'openssl passwd -1 -salt [salt] [password]' command. | |
| string | Md5FromFile (string filename) |
| Calculates the md5 hash of a given file. | |
| string | MessageBox (string message, string title, string buttons, string type) |
| bool | MoveFileOrFolder (string from, string to) |
| object | ParseJSON (string json) |
| bool | PutFileContents (string utf8Filename, string content) |
| int | Random () |
| int | random () |
| string | RandomString (int length) |
| string | Sha1 (string data) |
| string | sha1 (string data) |
| string | sha1_file (string filename) |
| string | sha1_file_prefix (string filename, string prefix, string postfix) |
| string | Sha1FromFile (string filename) |
| string | Sha1FromFileWithPrefix (string filename, string prefix, string postfix) |
| string | Sha256 (string data) |
| string | Sha256FromFile (string filename, int offset, size_t chunkSize) |
| string | Sha512 (string data) |
| string | Sha512FromFile (string filename, int offset, size_t chunkSize) |
| bool | ShellOpenUrl (string url) |
| void | Sleep (int msec) |
| void | sleep (int msec) |
| string | StrReplace (string str, string find, string replace) |
| string | ToJSON (object obj) |
| string | Translate (string key, string originalText) |
| string | url_encode (string value) |
| string | UrlEncode (string value) |
| string | Utf8ToAnsi (string str, int codepage) |
| void | WriteLog (string type, string message) |
Namespace containing functions and classes available in squirrel scripts.
| string AnsiToUtf8 | ( | string | str, |
| int | codepage | ||
| ) |
Converts a string from ANSI encoding to UTF-8.
You can find the codepage number you need here:
https://raw.githubusercontent.com/zenden2k/image-uploader/master/Source/Core/3rdpart/CodePages.cpp
Available only in Windows.
| string AskUserCaptcha | ( | INetworkClient * | nm, |
| string | url | ||
| ) |
Shows the captcha input dialog.
nm - network manager, url - address of the image with captcha. The return value is the text entered by the user.
| bool CreateDirectory | ( | string | path_, |
| unsigned int | mode | ||
| ) |
Creates a directory (recursively). The mode parameter is ignored in Windows.
| string ExtractFileNameNoExt | ( | string | fileName | ) |
Extract the file name without extension from the path.
| string ExtractFilePath | ( | string | fileName | ) |
Extract directory name from path.
| bool FileExists | ( | string | fileName | ) |
Checks if a file exists.
| string GenerateRandomFilename | ( | string | path, |
| int | suffixLen | ||
| ) |
Generates file path with alphanumeric suffix
| string GetAppLanguage | ( | ) |
Returns application's current language. For example : "en", "ru".
| string GetAppLanguageFile | ( | ) |
Returns name of the application's current language file (without .lng extension). For example: "English", "Russian".
| string GetAppLocale | ( | ) |
Returns application's current locale. For example : "en_US", "ru_RU".
| table GetAppVersion | ( | ) |
Returns a table containing information about application's version. For example:
| string GetCurrentThreadId | ( | ) |
Retrieves the thread identifier of the calling thread.
| string GetFileContents | ( | string | filename | ) |
| string GetFileContentsEx | ( | string | filename, |
| SQInteger | offset, | ||
| SQInteger | size, | ||
| bool | allowPartialRead | ||
| ) |
| string GetFileMimeType | ( | string | filename | ) |
Returns the MIME file type (for example, "text / html"), analyzing the contents of the file. File must exist. (in Windows, the FindMimeFromData function is used. In unix, the command 'file -b –mime-type' is used.).
| int GetFileSize | ( | string | filename | ) |
Returns the size of the file in bytes.
| double GetFileSizeDouble | ( | string | filename | ) |
| table GetImageInfo | ( | string | fileName | ) |
Returns a table containing information about image. For example:
| string GetScriptsDirectory | ( | ) |
Returns path to squirrel scripts directory.
| string GetTempDirectory | ( | ) |
Returns the directory for temporary files
| string hmac_sha1 | ( | string | key, |
| string | data, | ||
| bool | base64 | ||
| ) |
Generate a keyed hash value using the HMAC method and sha1 hashing algorythm
| data | Message to be hashed. |
| key | Shared secret key used for generating the HMAC variant of the message digest. |
| base64 | Generate in base64 format |
| string HmacSha1 | ( | string | key, |
| string | data, | ||
| bool | base64 | ||
| ) |
Generate a keyed hash value using the HMAC method and sha1 hashing algorythm
| data | Message to be hashed. |
| key | Shared secret key used for generating the HMAC variant of the message digest. |
| base64 | Generate in base64 format |
| object include | ( | string | filename | ) |
Includes and runs the script from file. filename should be relative to the scripts root directory.
| string InputDialog | ( | string | text, |
| string | defaultValue | ||
| ) |
Displays a prompt in a dialog box, waits for the user to input text or click a button, and returns a String containing the contents of the text box.
| defaultValue | Default text displayed in text box |
| string JsonEscapeString | ( | string | src | ) |
Escapes a string for use in JSON. Returns a string with quotes.
| string Md5 | ( | string | data | ) |
Calculates the md5 hash of a string.
| string md5 | ( | string | data | ) |
Calculates the md5 hash of a string.
| string md5_file | ( | string | filename | ) |
| string Md5Crypt | ( | string | password, |
| string | salt | ||
| ) |
Calculates the hash using MD5-Crypt algorythm. Similar to the 'openssl passwd -1 -salt [salt] [password]' command.
| string Md5FromFile | ( | string | filename | ) |
Calculates the md5 hash of a given file.
| string MessageBox | ( | string | message, |
| string | title, | ||
| string | buttons, | ||
| string | type | ||
| ) |
Shows a dialog box with a message
buttons possible values: OK, YES_NO, YES_NO_CANCEL, ABORT_RETRY_IGNORE,CANCEL_TRY_CONTINUE, OK_CANCEL, RETRY_CANCEL
type possible values: EXCLAMATION, WARNING, INFORMATION, QUESTION, ERROR
| bool MoveFileOrFolder | ( | string | from, |
| string | to | ||
| ) |
Renames/moves a file or folder.
| object ParseJSON | ( | string | json | ) |
Converts text containing a JSON document, into a squirrel type: a table (associative container), an array or a primitive type. For example, the original JSON document:
Squirrel script:
| bool PutFileContents | ( | string | utf8Filename, |
| string | content | ||
| ) |
Write data to a file
| int Random | ( | ) |
Returns a random number.
| int random | ( | ) |
| string RandomString | ( | int | length | ) |
Generates random string of given length
| string Sha1 | ( | string | data | ) |
Calculates the sha1-hash of a given string
| string sha1 | ( | string | data | ) |
| string sha1_file | ( | string | filename | ) |
Calculates the sha1-hash of a given file
| string sha1_file_prefix | ( | string | filename, |
| string | prefix, | ||
| string | postfix | ||
| ) |
Calculates the sha1-hash of a given file, prepeding file with prefix and adding postfix at the end while calculating hash
| string Sha1FromFile | ( | string | filename | ) |
Calculates the sha1-hash of a given file
| string Sha1FromFileWithPrefix | ( | string | filename, |
| string | prefix, | ||
| string | postfix | ||
| ) |
Calculates the sha1-hash of a given file, prepeding file with prefix and adding postfix at the end while calculating hash
| string Sha256 | ( | string | data | ) |
Calculates the sha256-hash of a given string
| string Sha256FromFile | ( | string | filename, |
| int | offset, | ||
| size_t | chunkSize | ||
| ) |
Calculates the sha256-hash of a given file
| string Sha512 | ( | string | data | ) |
Calculates the sha512-hash of a given string
| string Sha512FromFile | ( | string | filename, |
| int | offset, | ||
| size_t | chunkSize | ||
| ) |
Calculates the sha512-hash of a given file
| bool ShellOpenUrl | ( | string | url | ) |
Opens a URL/file in a standard browser/associated application.
| void Sleep | ( | int | msec | ) |
The script falls asleep for the specified number of milliseconds.
| void sleep | ( | int | msec | ) |
The script falls asleep for the specified number of milliseconds.
| string Translate | ( | string | key, |
| string | originalText | ||
| ) |
Returns text translated into the currently selected language. Every user-visible string in the script must be wrapped into this function. Internalization
| string url_encode | ( | string | value | ) |
URL-encodes string. This function is convenient when encoding a string to be used in a query part of a URL.
Use NetworkClient's nm.urlEncode() when possible instead.
| string UrlEncode | ( | string | value | ) |
URL-encodes string. This function is convenient when encoding a string to be used in a query part of a URL.
Use NetworkClient's nm.urlEncode() when possible instead.
| string Utf8ToAnsi | ( | string | str, |
| int | codepage | ||
| ) |
Converts a string from ANSI encoding to UTF-8.
You can find the codepage number you need here:
https://raw.githubusercontent.com/zenden2k/image-uploader/master/Source/Core/3rdpart/CodePages.cpp
Available only in Windows.
| void WriteLog | ( | string | type, |
| string | message | ||
| ) |
| type | message severity (possible values: "error", "warning", "info") |