/// <include file='IniDocument.xml' path='//Constructor[@name="ConstructorTextReaderType"]/docs/*' /> public IniDocument (TextReader reader, IniFileType type) { fileType = type; Load (reader); }
/// <include file='IniDocument.xml' path='//Constructor[@name="ConstructorStream"]/docs/*' /> public IniDocument (Stream stream) { fileType = IniFileType.Standard; Load (stream); }
/// <include file='IniDocument.xml' path='//Constructor[@name="ConstructorPath"]/docs/*' /> public IniDocument (string filePath) { fileType = IniFileType.Standard; Load (filePath); }
/// <include file='IniDocument.xml' path='//Constructor[@name="ConstructorPathType"]/docs/*' /> public IniDocument (string filePath, IniFileType type) { fileType = type; Load (filePath); }
/// <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; }
/// <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; }
/// <include file='IniConfigSource.xml' path='//Method[@name="LoadPath"]/docs/*' /> public void Load (string filePath, IniFileType type) { Load (new StreamReader (filePath), type); this.savePath = filePath; }
/// <include file='IniDocument.xml' path='//Constructor[@name="ConstructorPathType"]/docs/*' /> public IniDocument(string filePath, IniFileType type) { _filePath = filePath; fileType = type; Load(filePath); }
/// <include file='IniDocument.xml' path='//Constructor[@name="ConstructorStreamType"]/docs/*' /> public IniDocument(Stream stream, IniFileType type) { fileType = type; Load(stream); }
/// <include file='IniConfigSource.xml' path='//Constructor[@name="ConstructorPath"]/docs/*' /> public IniConfigSource (string filePath, IniFileType type) { Load(filePath, type); }
/// <include file='IniDocument.xml' path='//Constructor[@name="ConstructorStream"]/docs/*' /> public IniDocument(Stream stream) { fileType = IniFileType.Standard; Load(stream); }
/// <include file='IniDocument.xml' path='//Constructor[@name="ConstructorTextReaderType"]/docs/*' /> public IniDocument(TextReader reader, IniFileType type) { fileType = type; Load(reader); }
/// <include file='IniDocument.xml' path='//Constructor[@name="ConstructorTextReader"]/docs/*' /> public IniDocument(TextReader reader) { fileType = IniFileType.Standard; Load(reader); }
/// <include file='IniDocument.xml' path='//Constructor[@name="ConstructorStreamType"]/docs/*' /> public IniDocument (Stream stream, IniFileType type) { fileType = type; Load (stream); }
/// <include file='IniConfigSource.xml' path='//Method[@name="LoadTextReader"]/docs/*' /> public void Load(TextReader reader, IniFileType type) { Load(new IniDocument(reader, type)); }
/// <include file='IniDocument.xml' path='//Constructor[@name="ConstructorIniReader"]/docs/*' /> public IniDocument (IniReader reader) { fileType = IniFileType.Standard; Load (reader); }
/// <include file='IniDocument.xml' path='//Constructor[@name="ConstructorPath"]/docs/*' /> public IniDocument(string filePath) { _filePath = filePath; fileType = IniFileType.Standard; Load(filePath); }