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:value
keyPath
: The path of the Registrykey
: The key name set in the pathvalue
The value to be set in the registry
get-key
: This method gets a value from the registry.get-key : @str:keyPath, @str:key => @str
keyPath
: 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 => @process
path
: Path to executablearguments
Any 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:propName
properName
: The name of the property
run-function
: Runs the function from the process instance using C# reflection and returns itrun-function : @str:funcName
funcName
: 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.
datetime
class:- Methods:
now
returns the current date and time as a string along with optional parameter to format itdatetime now : ? @str:format
utcnow
returns the utc date and time as a string along with optional parameter to format itdatetime utcnow : ? @str:format
today
returns today's date and time as a string along with optional parameter to format itdatetime today : ? @str:format
compare
returns1
,0
, or-1
depending on the dates relation to the other datedatetime compare : @str:time1, @str:time2
unixepoch
returns the unix epoch date and time as a string along with optional parameter to format itdatetime unixepoch : ? @str:format
max-value
returns the max value date and time as a string along with optional parameter to format itdatetime max-value : ? @str:format
min-value
returns the min value date and time as a string along with optional parameter to format itdatetime min-value : ? @str:format
days-in-month
returns the days in the month as an intdatetime days-int-month : @str:_time
is-leep-year
returns if the year is a leep yeardatetime is-leep-year : @str:_time
day-of-year
returns the day of the year as intdatetime day-of-year : @str:_time
day-of-week
returns the day of the week as strdatetime day-of-week : @str:_time
is-daylight-savings-time
returns if the year is in daylight savings timedatetime is-daylight-savings-time : @str:_time
- Methods:
stopwatch
class:- Methods:
start
starts a stopwatch instance that counts upend
ends the stopwatch in the instanceelapsed-nanoseconds
returns the elapsed nanoseconds from the stopwatch instanceelapsed-miliseconds
returns the elapsed miliseconds from the stopwatch instanceelapsed-seconds
returns the elapsed seconds from the stopwatch instanceelapsed-minutes
returns the elapsed minutes from the stopwatch instanceelapsed-hours
returns the elapsed hours from the stopwatch instance
- Methods:
timer
class:- Methods:
new-instance
returns a new instance of the timer class based off of the variable valuesnew-instance : @int:hours, @int:minutes, @int:seconds, @int:miliseconds
start
starts a timer with the values from the instance propertiesstop
stops the timer instanceresume
resumes the timer instanceis-done
returns if the timer instance has elapsedis-not-done
returns if the timer instance has not elapsed
- Properties:
hours
the timer instance's hoursminutes
the timer instance's minutesseconds
the timer instance's secondsmiliseconds
the timer instance's miliseconds
- Methods:
HTTP
HTTP
Contains the functionality for basic HTTP requests.
http
class:install
method: Install file from url to file.GET
method: GET request.POST
method: 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 consoleinput
Returns the user input from the consoleistype object, type
: Returns@bool
if the object is the correct typeregexmatch @str:input, @str:pattern
: returns@bool
if 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 Aliasstring
in 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.