![]() |
VOOZH | about |
dotnet add package LinePutScript --version 1.11.9
NuGet\Install-Package LinePutScript -Version 1.11.9
<PackageReference Include="LinePutScript" Version="1.11.9" />
<PackageVersion Include="LinePutScript" Version="1.11.9" />Directory.Packages.props
<PackageReference Include="LinePutScript" />Project file
paket add LinePutScript --version 1.11.9
#r "nuget: LinePutScript, 1.11.9"
#:package LinePutScript@1.11.9
#addin nuget:?package=LinePutScript&version=1.11.9Install as a Cake Addin
#tool nuget:?package=LinePutScript&version=1.11.9Install as a Cake Tool
<img src="Lineput.png" alt="Lineput" height="150px" />
LinePutScript是一种数据交换格式定义行读取结构和描述其内容的标准语言
可以应用于 保存 设置,资源,模板文件 等各种场景
类似于XML或Json但是比XML和Json更易于使用(理论上)
本类库可以更轻松的创建,修改,保存LinePutScript
提供开源源代码 可以自行修改支持更多功能
一个LPS基本操作类,是所有LPS的根引用 如需操作lps文件,请使用这个文件
'LinePutScript.Core' 为.net Core版本
一个操作数据库的帮助类 获得LPS结构的数据而非xml
LinePutScript.SQLHelper.Core 为.net Core版本
LinePut是使用LinePutScript描述富文本的一种格式
这个类帮助转换LinePut为XAML FlowDocument
一个数据库构造类 通过映射LPS类型内容到内存, 从而实现基于LPS的快速数据库
一个简单的内存数据库通过使用LinePutScript.DataBase类实现 *注: 有内存无法正确回收的bug,可能需要重启解决
LinePutScript
Install-Package LinePutScript
LinePutScript.SQLHelper
Install-Package LinePutScript.SQLHelper
LinePutScript.LinePut
Install-Package LinePutScript.LinePut
通过nuget.org
下载nuget包
LinePutScript是一个最高4层*的数据储存语言 *最新1.4版本支持第四层,更多层次也可以使用套娃添加,但是较为繁琐
LineputScript由Line组成, Line由sub组成 sub为 subname#subinfo
这是一个基础的LineputScript文件
line1name#line1info:|sub1name#sub1info:|sub2name#sub2info:|text
line2name#line2info:|money#100:|goods#item1,item2,item3:|
通过C# 读取信息如下
LpsDocument tmp = new LpsDocument("line1...item3:|");
tmp.First().ToString(); //line1name#line1info:|sub1name#sub1info:|sub2name#sub2info:|text
tmp.First().First().ToString();//line1name#line1info:|
tmp["line1name"]["sub1name"].Info; //sub1info
tmp[0].Text;//text
tmp[1][(gint)"money"];//100
tmp[1]["good"].GetInfos()[1];//item2
分隔名称Name和信息Info
分隔 Sub 与 Sub 或 Line 与 Sub
lps文件支持多行并插入换行 例如
详细文档:| 这是一份文件:
| 文件内容为空
和
详细文档:| 这是一份文件\n 文件内容为空
表达效果相同
lps文件支持多行 例如
详细文档:| 这是一份文件:
: 文件内容为空
和
详细文档:| 这是一份文件 文件内容为空
表达效果相同
//读取LPS文件
LpsDocument Save = new LpsDocument(File.ReadAllText("GAMEPATH\\save1.lps"));
//或创建新LPS文件
Save = new LpsDocument();
案例要求:
方法1 (lps1.0) -- 早期版本lps 繁琐操作
Save.AddLine(new Line("money","10000"));//添加行 money 10000
Save.AddLine(new Line("computer",""));//添加行 compuer
Save.FindLine("computer").Add(new Sub("name","我的电脑")); //在computer行下面添加子类name和信息我的电脑
int Money = Convert.ToInt32((Save.FindLine("money").info)); //获得money储存的值
Save.FindLine("money").info = (Money + 500).ToString();//储存 money+500
方法2 (lps1.1) -- 上上版本lps 半繁琐操作
Save.AddLine("money").InfoToInt = 10000; //添加行 money 10000
Save.FindorAddLine("computer").FindorAddLine("name").Info = "我的电脑";//查找行computer, 如果没找到,则创建一个新的. 在该computer行下查找或创建子类name,并修改其信息为 我的电脑
Save.FindorAddLine("money").InfoToInt += 500;//给money+500
方法3 (lps1.2) -- 上版本lps 半繁琐操作
Save.AddLine("money").InfoToInt = 10000;
Save.FindorAddLine("computer").FindorAddLine("name").Info = "我的电脑";
Save["money"].InfoToInt += 500;//给money+500
方法4 (lps1.2+) -- 上版本lps后期 普通操作
Save.SetInt("money",10000);//设置 money 行 值(int)为10000
Save["computer"].SetString("name","我的电脑");
// 或这样 (对于string来说更方便)
Save["computer"]["name"].Info = "我的电脑";
Save.SetInt("money",Save.GetInt("money")+500);//给money+500
方法5 (lps1.3) -- 最新版本lps 高级操作
Save[(gint)"money"] = 10000; //设置 money 行 值(int)为10000
Save["computer"][(gstr)"name"] = "我的电脑";
Save[(gint)"money"] += 500;
//写入LPS源文件
File.WriteAllText("GAMEPATH\\save1.lps",Save.ToString());
money#10500:|
computer:|name#我的电脑:|
更多用法及参数参见对象管理器
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 is compatible. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 is compatible. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on LinePutScript:
| Package | Downloads |
|---|---|
|
VPet-Simulator.Core
虚拟桌宠模拟器 一个开源的桌宠软件, 可以内置到任何WPF应用程序 |
|
|
LinePutScript.Localization.WPF
WPF本地化类库, 支持文本和数值(不同语言的控件位置大小) 支持翻译接口(用于网络翻译等) 支持自动生成所需翻译文档 |
|
|
SoftwareVersion.Client
检查更新版本并提示用户升级或校对激活码确保激活码有效并对用户开放更多功能 *需要SoftwareVerisonManager配合 |
|
|
LinePutScript.SQLHelper
使用LineputScript的SQL帮助类 |
|
|
ChatVPet.ChatProcess
ChatVPetProcess 是一个用于处理和模拟自然语言交互的聊天系统。它通过整合 GPT 模型、知识库和工具,实现了对用户输入的自然语言的理解和处理。 |
Showing the top 2 popular GitHub repositories that depend on LinePutScript:
| Repository | Stars |
|---|---|
|
LorisYounger/VPet
虚拟桌宠模拟器 一个开源的桌宠软件, 可以内置到任何WPF应用程序
|
|
|
LorisYounger/VPet.Plugin.Demo
由开发者制作的桌宠插件案例, 这算是代码嵌入类型MOD的DEMO
|
1.11.0: 新增包装类Line/Sub和性能优化
新增 Line_C/Sub_C 支持包装类读写
支持 NetStandard
1.11.1 添加新参数 和 修复LineC序列化错误
LineAttribute 新增 `ignore`, 指示跳过不序列化某些内容
LPSConvert 转换 新增 `convertNoneLineAttribute`, 指示是否序列化不包含 `LineAttribute` 标记的参数
修复 `Line_C` 不序列化 `LineAttribute` 标记的参数
1.11.2: 修复在没有行内容的情况下注释失效
1.11.3: 修复`Sub.Split`描述与功能对应不上的错误
1.11.4: 为序列化添加 是否转换不带LineAttribute的类 可选参数
1.11.5: 支持序列化 Structure 和 去除属性后备字段
1.11.6 修复转换String时未进行转义和完善功能
1.11.7 支持`/null`参数, 允许在序列化时保持空List不为null
1.11.8 Convert为String做额外检查,兼容NetStand
1.11.9 支持循环List<Class>嵌套