Skip to content

Commit 2f88d2a

Browse files
committed
Update debug runner
1 parent e291a21 commit 2f88d2a

File tree

2 files changed

+24
-11
lines changed

2 files changed

+24
-11
lines changed

src/MessageStudio.Runner/Program.cs

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,27 @@
77

88
#else
99

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+
/*
2031
2132
using MessageStudio.Formats.BinaryText;
2233
using MessageStudio.Formats.BinaryText.Components;
@@ -69,4 +80,6 @@
6980
stopwatch.Stop();
7081
Console.WriteLine($"{stopwatch.ElapsedMilliseconds}ms");
7182
83+
*/
84+
7285
#endif

src/MessageStudio.Runner/Properties/launchSettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"profiles": {
33
"MessageStudio.Runner": {
44
"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\""
66
}
77
}
88
}

0 commit comments

Comments
 (0)