예제 #1
0
		/// <include file='IniDocument.xml' path='//Constructor[@name="ConstructorTextReaderType"]/docs/*' />
		public IniDocument (TextReader reader, IniFileType type)
		{
			fileType = type;
			Load (reader);
		}
예제 #2
0
		/// <include file='IniDocument.xml' path='//Constructor[@name="ConstructorStream"]/docs/*' />
		public IniDocument (Stream stream)
		{
			fileType = IniFileType.Standard;
			Load (stream);
		}
예제 #3
0
		/// <include file='IniDocument.xml' path='//Constructor[@name="ConstructorPath"]/docs/*' />
		public IniDocument (string filePath)
		{
			fileType = IniFileType.Standard;
			Load (filePath);
		}
예제 #4
0
		/// <include file='IniDocument.xml' path='//Constructor[@name="ConstructorPathType"]/docs/*' />
		public IniDocument (string filePath, IniFileType type)
		{
			fileType = type;
			Load (filePath);
		}
예제 #5
0
		/// <summary>
		/// Returns a proper INI reader depending upon the type parameter.
		/// </summary>
		private IniReader GetIniReader (TextReader reader, IniFileType type)
		{
			IniReader result = new IniReader (reader);

			switch (type)
			{
			case IniFileType.Standard:
				// do nothing
				break;
			case IniFileType.PythonStyle:
                result.AcceptNoAssignmentOperator = false;
				result.AcceptCommentAfterKey = false;
				result.SetCommentDelimiters (new char[] { ';', '#' });
				result.SetAssignDelimiters (new char[] { ':' });
				break;
			case IniFileType.SambaStyle:
				result.AcceptCommentAfterKey = false;
				result.SetCommentDelimiters (new char[] { ';', '#' });
				result.LineContinuation = true;
				break;
			case IniFileType.MysqlStyle:
				result.AcceptCommentAfterKey = false;
				result.AcceptNoAssignmentOperator = true;
				result.SetCommentDelimiters (new char[] { '#' });
				result.SetAssignDelimiters (new char[] { ':', '=' });
				break;
			case IniFileType.WindowsStyle:
				result.ConsumeAllKeyText = true;
				break;
			}

			return result;
		}
예제 #6
0
		/// <summary>
		/// Returns a proper IniWriter depending upon the type parameter.
		/// </summary>
		private IniWriter GetIniWriter (TextWriter reader, IniFileType type)
		{
			IniWriter result = new IniWriter (reader);

			switch (type)
			{
			case IniFileType.Standard:
			case IniFileType.WindowsStyle:
				// do nothing
				break;
			case IniFileType.PythonStyle:
				result.AssignDelimiter = ':';
				result.CommentDelimiter = '#';
				break;
			case IniFileType.SambaStyle:
			case IniFileType.MysqlStyle:
				result.AssignDelimiter = '=';
				result.CommentDelimiter = '#';
				break;
			}

			return result;
		}
예제 #7
0
		/// <include file='IniConfigSource.xml' path='//Method[@name="LoadPath"]/docs/*' />
		public void Load (string filePath, IniFileType type)
		{
			Load (new StreamReader (filePath), type);
			this.savePath = filePath;
		}
예제 #8
0
 /// <include file='IniDocument.xml' path='//Constructor[@name="ConstructorPathType"]/docs/*' />
 public IniDocument(string filePath, IniFileType type)
 {
     _filePath = filePath;
     fileType  = type;
     Load(filePath);
 }
예제 #9
0
 /// <include file='IniDocument.xml' path='//Constructor[@name="ConstructorStreamType"]/docs/*' />
 public IniDocument(Stream stream, IniFileType type)
 {
     fileType = type;
     Load(stream);
 }
예제 #10
0
		/// <include file='IniConfigSource.xml' path='//Constructor[@name="ConstructorPath"]/docs/*' />
		public IniConfigSource (string filePath, IniFileType type)
		{
            Load(filePath, type);
		}
예제 #11
0
 /// <include file='IniDocument.xml' path='//Constructor[@name="ConstructorStream"]/docs/*' />
 public IniDocument(Stream stream)
 {
     fileType = IniFileType.Standard;
     Load(stream);
 }
예제 #12
0
 /// <include file='IniDocument.xml' path='//Constructor[@name="ConstructorTextReaderType"]/docs/*' />
 public IniDocument(TextReader reader, IniFileType type)
 {
     fileType = type;
     Load(reader);
 }
예제 #13
0
 /// <include file='IniDocument.xml' path='//Constructor[@name="ConstructorTextReader"]/docs/*' />
 public IniDocument(TextReader reader)
 {
     fileType = IniFileType.Standard;
     Load(reader);
 }
예제 #14
0
		/// <include file='IniDocument.xml' path='//Constructor[@name="ConstructorStreamType"]/docs/*' />
		public IniDocument (Stream stream, IniFileType type)
		{
			fileType = type;
			Load (stream);
		}
예제 #15
0
		/// <include file='IniConfigSource.xml' path='//Method[@name="LoadTextReader"]/docs/*' />
        public void Load(TextReader reader, IniFileType type)
		{
            Load(new IniDocument(reader, type));
		}
예제 #16
0
		/// <include file='IniDocument.xml' path='//Constructor[@name="ConstructorIniReader"]/docs/*' />
		public IniDocument (IniReader reader)
		{
			fileType = IniFileType.Standard;
			Load (reader);
		}
예제 #17
0
 /// <include file='IniDocument.xml' path='//Constructor[@name="ConstructorPath"]/docs/*' />
 public IniDocument(string filePath)
 {
     _filePath = filePath;
     fileType  = IniFileType.Standard;
     Load(filePath);
 }