v 0.9
-- module = require "ModuleName"
local ct = require "CommonTools"
-- For nested module (like "StringOr")
-- load nested module only
local strOr = (require "CommonTools").StringOr-- module:FunctionName()
local tFRec = ct:GetFilesRecursive(ct:GetCurrentDir(), "lua", "hs")
-- for nested module
-- direct call
local s, e = ct.StringOr:find("foobar", {"o","b"})
-- or assign the sub module
local strOr = ct.StringOr
local s, e = strOr:find("foobar", {"o","b"})| SYSTEM | |
| CommandlineRead | Runs a command in the Windows shell and saves the result rows in a table |
| FileExists | Checks if a file exists |
| FolderCreate | Creates a folder (if not exists) |
| FolderExists | Checks if a folder exists |
| GetCurrentDir | Returns the script directory |
| GetFilesRecursive | Returns a table with all recursive files (full path name) from given root. You can use filter for file type and attributes. |
| GetFolderRecursive | Returns a table with all recursive sub folders (full path name) from given root. You can use filter for attributes. |
| OSNow | Returns a table with date & time fields from now |
| OSDate | Returns a string with the current date as "YYYY-MM-DD" |
| OSTime | Returns a string with the current time as "hh:mm:ss" |
| require_protected | Load library protected No longer usable due to the use of Lua 5.3 in SciTE |
| EDITOR | |
| EditorCodingCookieLine | Checks the current buffer for coding cookie. Returns the line number from this or nil. |
| EditorDeleteLine | Deletes the passed line number from editor. Returns line content if success. |
| EditorGetCommentChar | Returns the character(s) for a line comment of the passed file type (or default: from current buffer), if defined. |
| EditorGetEOL | Returns length, mode of EOL and the EOL character(s) in current SciTE buffer |
| EditorMoveLine | Moves a line in editor up/down by param count (negative=up/positive=down). |
| EditorTabColPosInLine | Returns column and position of previous/next TAB in passed line |
| EditorTabReplace | Replaces all TAB in the file currently open in SciTE with spaces |
| MISC | |
| ASCIIcompare | Comparison of two ASCII strings, optionally case-insensitive (default: case-sensitive). Return of both strings in sorted order. |
| EscapeMagic | Escapes all magic characters in a string: ( ) . % + - * ? [ ^ $ |
| InSensePattern | Creates an insensitive pattern string ("Hallo" --> "[Hh][Aa][Ll][Ll][Oo]"). Ascii chars only! |
| LineTabReplace | Replaces TAB in a line with the number of spaces corresponding to the column. |
| Power2And | Checks if a passed uint value contains a given power of 2. |
| PropExt | Asks for property specified by filter.extension or extension |
| Split | Splits a string by the passed delimiter into a table (each character as one element only with ASCII characters) |
| StringOr | A nested module with string functions: .find / .gmatch / .gsub / .match Lua patterns do not support alternations. Therefore, these functions can be called here with a list of patterns applied to the string. The pattern works: "patt1 or patt2 or patt_n" |
| StringOr.find | Returns start/end of the first occurence of the first matching pattern. |
| StringOr.gmatch | Returns a table with all occurences of each matching pattern. |
| StringOr.gsub | Returns a string in which all (or _n) occurrences of each matching pattern are replaced. |
| StringOr.match | Returns the first occurence of the first matching pattern. |
| StripSpaceChar | Strip space characters (%s) from a string. |
| StringUTF8Len | Get the number of characters (not the number of bytes, like string.len) of a string with UTF8 characters |
| StringUTF8Split | Splits a string by the passed delimiter into a table (each character as one element with UTF8 characters too) |
| Ternary | The ternary operator as function (condition, if_true, if_false) |
| Trim | Trim a count of chars from a strings left or right side Optionally also remove remaining spaces |
| UrlEncode | Returns the given string encoded for use in URL |
| AU3 - SPECIFIC | |
| GetIncludePathes | Returns a table with locations of AU3 - include files in the system |