Example #1
0
        public bool Evaluate(IContext context, TextWriter writer, String logTag, Stream instream)
        {
            // first, parse - convert ParseException if thrown
            TextReader br       = null;
            String     encoding = null;

            try
            {
                encoding = runtimeInstance.GetString(RuntimeConstants.INPUT_ENCODING, RuntimeConstants.ENCODING_DEFAULT);
                br       = new StreamReader(new StreamReader(instream, Encoding.GetEncoding(encoding)).BaseStream);
            }
            catch (IOException ioException)
            {
                String msg = string.Format("Unsupported input encoding : {0} for template {1}", encoding, logTag);
                throw new ParseErrorException(msg, ioException);
            }

            return(Evaluate(context, writer, logTag, br));
        }