Beispiel #1
0
        public static void Parse(string ini, IParserCallbacks callbacks)
        {
            if (ini == null)
            {
                throw new ArgumentNullException("ini");
            }
            if (callbacks == null)
            {
                throw new ArgumentNullException("callbacks");
            }

            PhpIniParser parser = new PhpIniParser(ini, callbacks);

            parser.TopLevel();
        }
Beispiel #2
0
        /// <summary>
        /// Parses an INI-style configuration file.
        /// </summary>
        /// <param name="stream">A stream referring to the file to parse. Should be open in binary mode.</param>
        /// <param name="callbacks">Implementation of the parser callbacks invoked during parsing.</param>
        /// <exception cref="ParseException">Parse error.</exception>
        /// <exception cref="ArgumentNullException"><paramref name="stream"/> or <paramref name="callbacks"/> is a <B>null</B> reference.</exception>
        /// <exception cref="ArgumentException">Stream is was not opened as binary.</exception>
        public static void Parse(PhpStream stream, IParserCallbacks callbacks)
        {
            if (stream == null)
            {
                throw new ArgumentNullException("stream");
            }
            if (!stream.IsBinary)
            {
                throw new ArgumentException("Stream must be binary");
            }
            if (callbacks == null)
            {
                throw new ArgumentNullException("callbacks");
            }

            PhpIniParser parser = new PhpIniParser(stream, callbacks);

            parser.TopLevel();
        }
Beispiel #3
0
        public static void Parse(string ini, IParserCallbacks callbacks)
        {
            if (ini == null)
                throw new ArgumentNullException("ini");
            if (callbacks == null)
                throw new ArgumentNullException("callbacks");

            PhpIniParser parser = new PhpIniParser(ini, callbacks);
            parser.TopLevel();
        }
Beispiel #4
0
		/// <summary>
		/// Parses an INI-style configuration file.
		/// </summary>
		/// <param name="stream">A stream referring to the file to parse. Should be open in binary mode.</param>
		/// <param name="callbacks">Implementation of the parser callbacks invoked during parsing.</param>
		/// <exception cref="ParseException">Parse error.</exception>
		/// <exception cref="ArgumentNullException"><paramref name="stream"/> or <paramref name="callbacks"/> is a <B>null</B> reference.</exception>
		/// <exception cref="ArgumentException">Stream is was not opened as binary.</exception>
		public static void Parse(PhpStream stream, IParserCallbacks callbacks)
		{
			if (stream == null)
				throw new ArgumentNullException("stream");
			if (!stream.IsBinary)
				throw new ArgumentException("Stream must be binary");
			if (callbacks == null)
				throw new ArgumentNullException("callbacks");

			PhpIniParser parser = new PhpIniParser(stream, callbacks);
			parser.TopLevel();
		}