/// <summary> Constructor for custom HTTP access. /// </summary> /// <param name="connection">A fully conditioned connection. /// </param> /// <param name="fb">The object to use for message communication. /// /// </param> public Parser(WebRequest connection, ParserFeedback fb) { InitBlock(); Feedback = fb; Scanners = null; resourceLocn = null; reader = null; character_set = DEFAULT_CHARSET; url = null; input = null; Tag.TagParser = new TagParser(feedback); Connection = connection; }
/// <summary> This constructor enables the construction of test cases, with readers /// associated with test string buffers. It can also be used with readers of the user's choice /// streaming data into the parser.<p/> /// <B>Important:</B> If you are using this constructor, and you would like to use the parser /// to parse multiple times (multiple calls to parser.GetEnumerator()), you must ensure the following:<br> /// <ul> /// <li>Before the first parse, you must mark the reader for a length that you anticipate (the size of the stream).</li> /// <li>After the first parse, calls to GetEnumerator() must be preceded by calls to: /// <pre> /// parser.getReader().Reset(); /// </pre> /// </li> /// </ul> /// </summary> /// <param name="rd">The reader to draw characters from. /// </param> /// <param name="fb">The object to use when information, /// warning and error messages are produced. If <em>null</em> no feedback /// is provided. /// /// </param> public Parser(NodeReader rd, ParserFeedback fb) { InitBlock(); Feedback = fb; Scanners = null; resourceLocn = null; reader = null; character_set = DEFAULT_CHARSET; url = null; input = null; Reader = rd; Tag.TagParser = new TagParser(feedback); }
/// <summary> Creates a Parser object with the location of the resource (URL or file) /// You would typically create a DefaultParserFeedback object and pass it in. /// </summary> /// <param name="resourceLocn">Either the URL or the filename (autodetects). /// A standard HTTP GET is performed to read the content of the URL. /// </param> /// <param name="feedback">The ParserFeedback object to use when information, /// warning and error messages are produced. If <em>null</em> no feedback /// is provided. /// </param> /// <seealso cref="">#Parser(WebRequest, ParserFeedback) /// /// </seealso> public Parser(string resourceLocn, ParserFeedback feedback) : this(ParserHelper.OpenConnection(resourceLocn, feedback), feedback) { }