internal static SDF StreamParseString(string s, Schema schema = null) { var fn = MakeTempFile(s); try { return(schema == null ? StreamingParser.Parse(fn) : StreamingParser.ParseAndValidateSchema(fn, schema)); } finally { DeleteTempFile(fn); } }
private static void ReadInputWithStreamingAndValidateBySchema(string[] args) { if (args.Length != REQUIRED_ARGUMENTS_LENGTH_IS_TWO) { Console.Out.WriteLine("Usage: Console <input SDF> <schema SDF>"); return; } var schema = new Schema(args[INPUT_SDF_SCHEMA_FILENAME_ARGUMENT_INDEX]); var data = StreamingParser.ParseAndValidateSchema(args[INPUT_SDF_FILENAME_ARGUMENT_INDEX], schema); Printer.Print(data); }