Releases: EZCodeLanguage/Packages
Releases · EZCodeLanguage/Packages
Windows-OS
Windows-OS
This package includes process and registry classes
registry:set-key: This method sets a string value into the registry.set-key : @str:keyPath, @str:key, @str:valuekeyPath: The path of the Registrykey: The key name set in the pathvalueThe value to be set in the registry
get-key: This method gets a value from the registry.get-key : @str:keyPath, @str:key => @strkeyPath: The path of the Registrykey: The key name to get in the path
local-machine: Returns the Local Machine Registry Pathlocal-machine => @str
current-user: Returns the Current User Registry Pathcurrent-user => @str
users: Returns the registry Path of all of the usersusers => @str
classes-root: Returns the registry path of the classes rootclasses-root => @str
current-config: Returns the registry path of the current configcurrent-config => @str
performance-data: Returns the registry path of the performance dataperformance-data => @str
process:start: Starts a process from path and returns process instancestart : @str:path, ? @str:arguments => @processpath: Path to executableargumentsAny arguments with it
name: Returns the Process instance's namename => @str
kill: Kills the process instancekill
get-property: Gets a property from the process instance using C# reflection and returns itget-property : @str:propNameproperName: The name of the property
run-function: Runs the function from the process instance using C# reflection and returns itrun-function : @str:funcNamefuncName: The function name to run
get-current-process: Retuns the current processget-current-process => @process
get-process-by-id: Returns a C# System.Diagnostics.Process class instance from the process IDget-process-by-id : @int:_id, ? @str:_machineName_id: The Process ID_machineName: The machine's name to check on
get-processes: Returns an array of the C# System.Diagnostics.Process class of every Process runningget-processes : ? @str:_machineName_machineName: The machine to get processes from
get-processes-by-name: Returns a C# System.Diagnostics.Process class instance from the process nameget-processes-by-name : @str:_name ? @str:_machineName_name: The Process name_machineName: The machine's name to check on
Time
Timer
Contains classes for time related functions and objects.
datetimeclass:- Methods:
nowreturns the current date and time as a string along with optional parameter to format itdatetime now : ? @str:formatutcnowreturns the utc date and time as a string along with optional parameter to format itdatetime utcnow : ? @str:formattodayreturns today's date and time as a string along with optional parameter to format itdatetime today : ? @str:formatcomparereturns1,0, or-1depending on the dates relation to the other datedatetime compare : @str:time1, @str:time2unixepochreturns the unix epoch date and time as a string along with optional parameter to format itdatetime unixepoch : ? @str:formatmax-valuereturns the max value date and time as a string along with optional parameter to format itdatetime max-value : ? @str:formatmin-valuereturns the min value date and time as a string along with optional parameter to format itdatetime min-value : ? @str:formatdays-in-monthreturns the days in the month as an intdatetime days-int-month : @str:_timeis-leep-yearreturns if the year is a leep yeardatetime is-leep-year : @str:_timeday-of-yearreturns the day of the year as intdatetime day-of-year : @str:_timeday-of-weekreturns the day of the week as strdatetime day-of-week : @str:_timeis-daylight-savings-timereturns if the year is in daylight savings timedatetime is-daylight-savings-time : @str:_time
- Methods:
stopwatchclass:- Methods:
startstarts a stopwatch instance that counts upendends the stopwatch in the instanceelapsed-nanosecondsreturns the elapsed nanoseconds from the stopwatch instanceelapsed-milisecondsreturns the elapsed miliseconds from the stopwatch instanceelapsed-secondsreturns the elapsed seconds from the stopwatch instanceelapsed-minutesreturns the elapsed minutes from the stopwatch instanceelapsed-hoursreturns the elapsed hours from the stopwatch instance
- Methods:
timerclass:- Methods:
new-instancereturns a new instance of the timer class based off of the variable valuesnew-instance : @int:hours, @int:minutes, @int:seconds, @int:milisecondsstartstarts a timer with the values from the instance propertiesstopstops the timer instanceresumeresumes the timer instanceis-donereturns if the timer instance has elapsedis-not-donereturns if the timer instance has not elapsed
- Properties:
hoursthe timer instance's hoursminutesthe timer instance's minutessecondsthe timer instance's secondsmilisecondsthe timer instance's miliseconds
- Methods:
HTTP
HTTP
Contains the functionality for basic HTTP requests.
httpclass:installmethod: Install file from url to file.GETmethod: GET request.POSTmethod: POST request.
http install : github.com/EZCodeLanguage/Packages/releases/download/main-package/Main.zip, C:/path/main.zip
undefined result => http GET : ez-code.web.app
http POST : url.com, data, contentType
Entire Class:
class http {
method install : @str:url, @str:path {
runexec http.dll.Http.HTTP.WebInstall ~> {url}, {path}
}
method GET : @str:url => @str {
return runexec http.dll.Http.HTTP.GET ~> {url}
}
method POST : @str:url, @str:data, @str:contentType => @str {
return runexec http.dll.Http.HTTP.POST ~> {url}, {data}, {contentType}
}
}
Main
Main Package
The Main Package contains all of the classes and methods to make EZCode usable. This package is automatically included in the scope. If this is not desired, use exclude main to remove it from the scope. This package includes the following:
- The global methods:
print @str:text: Prints text to the consoleclear: Clears the consoleinputReturns the user input from the consoleistype object, type: Returns@boolif the object is the correct typeregexmatch @str:input, @str:pattern: returns@boolif the regex match input matches the patternenvironment @str:property, ? param1, param2: Access to Environment properties from C# library
- The math Methods:
add @int:num1, @int:num2: add numberssubtract @int:num1, @int:num2: subtract numbersmultiply @int:num1, @int:num2: multiply numbersdivide @int:num1, @int:num2: divide numberspi: pi constantclamp @int:num, @int:min, @int:max: clamp number between 2 numbersavg ! @int:num_params: average of numbersoperate @str:function, ! @float:parameters: everything in MathF from C# class.
- The basic classes:
bool: The bool class and the methods in itstr: The string class and the methods in it. It contains the explicit watch for anything inside''. Also the Aliasstringin the class.int: The int class and the methods in itfloat: The float class and the methods in itchar: The charclass and the methods in itexpressions: The expressions class is used to solve anything inside the explicit watch().var: An intermediate variable class that can hold any value type.