File tree Expand file tree Collapse file tree 2 files changed +24
-11
lines changed Expand file tree Collapse file tree 2 files changed +24
-11
lines changed Original file line number Diff line number Diff line change 7
7
8
8
#else
9
9
10
- // using MessageStudio.Formats.BinaryText;
11
- //
12
- // byte[] buffer = File.ReadAllBytes(args[0]);
13
- //
14
- // Msbt msbt = Msbt.FromBinary(buffer);
15
- // string yaml = msbt.ToYaml();
16
- //
17
- // Msbt yamlMsbt = Msbt.FromYaml(yaml);
18
- // Console.WriteLine(yaml + "\n\n");
19
- // Console.WriteLine(yaml == yamlMsbt.ToYaml());
10
+ using MessageStudio . Common ;
11
+ using MessageStudio . Formats . BinaryText ;
12
+
13
+ byte [ ] buffer = File . ReadAllBytes ( args [ 0 ] ) ;
14
+
15
+ Msbt msbt = Msbt . FromBinary ( buffer ) ;
16
+ string yaml = msbt . ToYaml ( ) ;
17
+
18
+ Msbt yamlMsbt = Msbt . FromYaml ( yaml ) ;
19
+
20
+ File . WriteAllText ( args [ 1 ] , yaml ) ;
21
+
22
+ byte [ ] toBinary = yamlMsbt . ToBinary ( TextEncoding . UTF8 ) ;
23
+ File . WriteAllBytes ( args [ 2 ] , toBinary ) ;
24
+
25
+ Msbt fromBinary = Msbt . FromBinary ( toBinary ) ;
26
+ string toYaml = fromBinary . ToYaml ( ) ;
27
+
28
+ Console . WriteLine ( yaml == toYaml ) ;
29
+
30
+ /*
20
31
21
32
using MessageStudio.Formats.BinaryText;
22
33
using MessageStudio.Formats.BinaryText.Components;
69
80
stopwatch.Stop();
70
81
Console.WriteLine($"{stopwatch.ElapsedMilliseconds}ms");
71
82
83
+ */
84
+
72
85
#endif
Original file line number Diff line number Diff line change 2
2
"profiles" : {
3
3
"MessageStudio.Runner" : {
4
4
"commandName" : " Project" ,
5
- "commandLineArgs" : " \" D:\\ bin\\ Msbt \\ test .msbt\" "
5
+ "commandLineArgs" : " \" D:\\ bin\\ .todo \\ MessageStudio \\ UTF-8 \\ Shop.msbt \" \" D: \\ bin \\ .todo \\ MessageStudio \\ UTF-8 \\ Shop.yml \" \" D: \\ bin \\ .todo \\ MessageStudio \\ UTF-8 \\ (dst)-Shop .msbt\" "
6
6
}
7
7
}
8
8
}
You can’t perform that action at this time.
0 commit comments