我有这个Lua文件,其中包含以下代码:
options = { ["VR"] = { ["box_mouse_cursor"] = false, ["custom_IPD"] = 63.5, ["custom_IPD_enable"] = true, ["enable"] = false, ["hand_controllers"] = false, ["pixel_density"] = 2, ["prefer_built_in_audio"] = true, ["use_mouse"] = true, } }我试图找到一个程序集,将其解析为我的.Net Framework 4.5.1 C#项目可用的东西。 LuaInterface是.NET标准2.0项目,不能在.Net Framework 4.5.1中使用,因此不在桌面上。
是否有任何工具可以解析这些信息,并希望再次将其序列化?
I have this Lua file which contains the following code:
options = { ["VR"] = { ["box_mouse_cursor"] = false, ["custom_IPD"] = 63.5, ["custom_IPD_enable"] = true, ["enable"] = false, ["hand_controllers"] = false, ["pixel_density"] = 2, ["prefer_built_in_audio"] = true, ["use_mouse"] = true, } }I am trying to find an assembly that will parse this into something usable by my .Net Framework 4.5.1 C# project. LuaInterface is .NET standard 2.0 project which can't be used in .Net Framework 4.5.1, so that's off the table.
Are there any tools available that can parse this information, and hopefully serialize it back again?
最满意答案
我会考虑使用Lua来编码您拥有JSON的嵌套表结构。 这将为您提供一种标准格式来写入磁盘和/或轻松传递到另一个代码库。 当你在线搜索( lua table encode json )或者甚至在这里时,有很多选项可供选择。当有类似的问题时,人们正试图踩踏他们的JSON编码/解码Lua库。 例如,这是相反的情况。
I would consider using Lua to encode the nested table structure that you have into JSON. That would give you a standard format to write to disk and/or easily pass into another code base. There are quite a few options available when you search for that online (lua table encode json) or even here on SO people are trying to pedal their JSON encode/decode Lua libraries when similar questions were asked. Here, for example, is the reverse case.
更多推荐
发布评论