Skip to content

Releases: EZCodeLanguage/Packages

Windows-OS

01 Jun 20:47
Compare
Choose a tag to compare

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 Registry
        • key: The key name set in the path
        • value 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 Registry
        • key: The key name to get in the path
    • local-machine: Returns the Local Machine Registry Path
      • local-machine => @str
    • current-user: Returns the Current User Registry Path
      • current-user => @str
    • users: Returns the registry Path of all of the users
      • users => @str
    • classes-root: Returns the registry path of the classes root
      • classes-root => @str
    • current-config: Returns the registry path of the current config
      • current-config => @str
    • performance-data: Returns the registry path of the performance data
      • performance-data => @str
  • process:
    • start: Starts a process from path and returns process instance
      • start : @str:path, ? @str:arguments => @process
        • path: Path to executable
        • arguments Any arguments with it
    • name: Returns the Process instance's name
      • name => @str
    • kill: Kills the process instance
      • kill
    • get-property: Gets a property from the process instance using C# reflection and returns it
      • get-property : @str:propName
        • properName: The name of the property
    • run-function: Runs the function from the process instance using C# reflection and returns it
      • run-function : @str:funcName
        • funcName: The function name to run
    • get-current-process: Retuns the current process
      • get-current-process => @process
    • get-process-by-id: Returns a C# System.Diagnostics.Process class instance from the process ID
      • get-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 running
      • get-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 name
      • get-processes-by-name : @str:_name ? @str:_machineName
        • _name: The Process name
        • _machineName: The machine's name to check on

Time

25 May 01:30
Compare
Choose a tag to compare

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 it datetime now : ? @str:format
      • utcnow returns the utc date and time as a string along with optional parameter to format it datetime utcnow : ? @str:format
      • today returns today's date and time as a string along with optional parameter to format it datetime today : ? @str:format
      • compare returns 1, 0, or -1 depending on the dates relation to the other date datetime compare : @str:time1, @str:time2
      • unixepoch returns the unix epoch date and time as a string along with optional parameter to format it datetime unixepoch : ? @str:format
      • max-value returns the max value date and time as a string along with optional parameter to format it datetime max-value : ? @str:format
      • min-value returns the min value date and time as a string along with optional parameter to format it datetime min-value : ? @str:format
      • days-in-month returns the days in the month as an int datetime days-int-month : @str:_time
      • is-leep-year returns if the year is a leep year datetime is-leep-year : @str:_time
      • day-of-year returns the day of the year as int datetime day-of-year : @str:_time
      • day-of-week returns the day of the week as str datetime day-of-week : @str:_time
      • is-daylight-savings-time returns if the year is in daylight savings time datetime is-daylight-savings-time : @str:_time
  • stopwatch class:
    • Methods:
      • start starts a stopwatch instance that counts up
      • end ends the stopwatch in the instance
      • elapsed-nanoseconds returns the elapsed nanoseconds from the stopwatch instance
      • elapsed-miliseconds returns the elapsed miliseconds from the stopwatch instance
      • elapsed-seconds returns the elapsed seconds from the stopwatch instance
      • elapsed-minutes returns the elapsed minutes from the stopwatch instance
      • elapsed-hours returns the elapsed hours from the stopwatch instance
  • timer class:
    • Methods:
      • new-instance returns a new instance of the timer class based off of the variable values new-instance : @int:hours, @int:minutes, @int:seconds, @int:miliseconds
      • start starts a timer with the values from the instance properties
      • stop stops the timer instance
      • resume resumes the timer instance
      • is-done returns if the timer instance has elapsed
      • is-not-done returns if the timer instance has not elapsed
    • Properties:
      • hours the timer instance's hours
      • minutes the timer instance's minutes
      • seconds the timer instance's seconds
      • miliseconds the timer instance's miliseconds

HTTP

18 May 21:39
Compare
Choose a tag to compare

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

12 May 02:18
95a9660
Compare
Choose a tag to compare

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 console
    • clear: Clears the console
    • input Returns the user input from the console
    • istype object, type: Returns @bool if the object is the correct type
    • regexmatch @str:input, @str:pattern: returns @bool if the regex match input matches the pattern
    • environment @str:property, ? param1, param2: Access to Environment properties from C# library
  • The math Methods:
    • add @int:num1, @int:num2: add numbers
    • subtract @int:num1, @int:num2: subtract numbers
    • multiply @int:num1, @int:num2: multiply numbers
    • divide @int:num1, @int:num2: divide numbers
    • pi: pi constant
    • clamp @int:num, @int:min, @int:max: clamp number between 2 numbers
    • avg ! @int:num_params: average of numbers
    • operate @str:function, ! @float:parameters: everything in MathF from C# class.
  • The basic classes:
    • bool: The bool class and the methods in it
    • str: The string class and the methods in it. It contains the explicit watch for anything inside ''. Also the Alias string in the class.
    • int: The int class and the methods in it
    • float: The float class and the methods in it
    • char: The charclass and the methods in it
    • expressions: The expressions class is used to solve anything inside the explicit watch ().
    • var: An intermediate variable class that can hold any value type.