Skip to content

Commit 92c051c

Browse files
2 parents 333e944 + a86adc0 commit 92c051c

26 files changed

Lines changed: 93 additions & 399 deletions

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
.vscode/
1+
.vscode/
2+
bin/
3+
obj/

IO/IO.ezcode

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class file {
2+
method read : @str:path => @str {
3+
return runexec io-package.dll.io_package.IO.FileRead ~> {path}
4+
}
5+
method write : @str:path, @str:text => @str {
6+
return runexec io-package.dll.io_package.IO.FileWrite ~> {path}, {text}
7+
}
8+
method create : @str:path => @str {
9+
return runexec io-package.dll.io_package.IO.FileCreate ~> {path}
10+
}
11+
}

IO/file-test.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hello world

IO/io-package/IO.cs

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
using EZCodeLanguage;
2+
3+
namespace io_package
4+
{
5+
public class IO
6+
{
7+
public static string FixPath(string path) => path.Replace("/", "\\").Replace(" : \\", ":\\");
8+
public static string FileRead(object _path)
9+
{
10+
try
11+
{
12+
string path = EZHelp.GetParameter<string>(_path, "str");
13+
path = FixPath(path);
14+
return File.ReadAllText(path);
15+
}
16+
catch (Exception e)
17+
{
18+
throw EZHelp.ThrowError(e);
19+
}
20+
}
21+
public static void FileWrite(object _path, object _text)
22+
{
23+
try
24+
{
25+
string path = EZHelp.GetParameter<string>(_path, "str");
26+
string text = EZHelp.GetParameter<string>(_text, "str");
27+
path = FixPath(path);
28+
File.WriteAllText(path, text);
29+
}
30+
catch (Exception e)
31+
{
32+
throw EZHelp.ThrowError(e);
33+
}
34+
}
35+
public static void FileCreate(object _path)
36+
{
37+
try
38+
{
39+
string path = EZHelp.GetParameter<string>(_path, "str");
40+
path = FixPath(path);
41+
File.Create(path).Close();
42+
}
43+
catch (Exception e)
44+
{
45+
throw EZHelp.ThrowError(e);
46+
}
47+
}
48+
}
49+
}

IO/io-package/io-package.csproj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<RootNamespace>io_package</RootNamespace>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<ProjectReference Include="..\..\..\EZCode\EZCode\EZCode.csproj" />
12+
</ItemGroup>
13+
14+
</Project>

IO/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"Name":"io",
3+
"Files": [
4+
"IO.ezcode"
5+
],
6+
"Configuration":{
7+
"LibraryDirectory":"io-package\\bin\\Debug\\net8.0\\",
8+
"GlobalPackages":[
9+
"main"
10+
]
11+
}
12+
}

WinForms (not working)/WinFormsEZCodeLibrary/obj/Debug/net8.0-windows/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs

Lines changed: 0 additions & 4 deletions
This file was deleted.

WinForms (not working)/WinFormsEZCodeLibrary/obj/Debug/net8.0-windows/WinFormsEZCodeLibrary.AssemblyInfo.cs

Lines changed: 0 additions & 25 deletions
This file was deleted.

WinForms (not working)/WinFormsEZCodeLibrary/obj/Debug/net8.0-windows/WinFormsEZCodeLibrary.AssemblyInfoInputs.cache

Lines changed: 0 additions & 1 deletion
This file was deleted.

WinForms (not working)/WinFormsEZCodeLibrary/obj/Debug/net8.0-windows/WinFormsEZCodeLibrary.GeneratedMSBuildEditorConfig.editorconfig

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)