1
0
mirror of https://github.com/twiglet/cs2j.git synced 2025-01-18 13:15:17 +01:00

tidy up for trial version

This commit is contained in:
Kevin Glynn 2011-07-20 15:22:21 +02:00
parent a45fb077e8
commit b14a999e5c

View File

@ -5,6 +5,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using System.Text.RegularExpressions;
using System.IO; using System.IO;
using System.Xml; using System.Xml;
using Antlr.Runtime.Tree; using Antlr.Runtime.Tree;
@ -369,7 +370,7 @@ namespace Twiglet.CS2J.Translator
// Verify the signature of the signed XML. // Verify the signature of the signed XML.
if (!VerifyXml(xmlDoc, RsaKey)) if (!VerifyXml(xmlDoc, RsaKey))
{ {
Console.Out.WriteLine("Bad / Missing signature found for " + fullName); Console.Out.WriteLine("WARNING: Bad / Missing signature found for " + fullName);
badXmlTxCount--; badXmlTxCount--;
if (badXmlTxCount <= 0) if (badXmlTxCount <= 0)
{ {
@ -418,19 +419,17 @@ namespace Twiglet.CS2J.Translator
cfg.DebugLevel = saveDebugLevel; cfg.DebugLevel = saveDebugLevel;
} }
private static string limit(string inp) { private static string limit(string inp) {
if (numLines > numLines - 1) if (numLines > numLines - 1)
return inp; return inp;
// TRIAL ONLY // TRIAL ONLY
String[] lines = inp.Split(newLines, numLines+1, StringSplitOptions.None); String[] lines = inp.Split(newLines, numLines+1, StringSplitOptions.None);
if (lines.Length <= numLines) { if (lines.Length <= numLines) {
return inp; return inp;
} }
String[] res = new String[numLines+1]; lines[numLines] = Regex.Replace(lines[numLines], "\\w", "x");^M
Array.Copy(lines, res, numLines); return String.Join(Environment.NewLine, lines);^M
res[numLines] = ""; }
return String.Join(Environment.NewLine, res);
}
// Here's where we do the real work... // Here's where we do the real work...
public static void translateFile(string fullName) public static void translateFile(string fullName)