Skip to content

Spell check source code and correct typo in README #210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ comments are written before the element they refer to.
To query, add or remove comments, access the property `Comments` available both in `SectionData` and `KeyData` models.

```csharp
var listOfCommentsForSection = config.["user_settings"].Comments;
var listOfCommentsForSection = config["user_settings"].Comments;
var listOfCommentsForKey = config["user_settings"].GetKeyData("resolution").Comments;
```

Expand Down
2 changes: 1 addition & 1 deletion src/IniParser.Example/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static void Main()
#Update rate in msecs
setUpdate = 100

#Maximun errors before quit
#Maximum errors before quit
setMaxErrors = 2

#Users allowed to access the system
Expand Down
2 changes: 1 addition & 1 deletion src/IniParser.Example/TestIniFile.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#Update rate in msecs
setUpdate = 100

#Maximun errors before quit
#Maximum errors before quit
setMaxErrors = 2

#Users allowed to access the system
Expand Down
4 changes: 2 additions & 2 deletions src/IniParser.Tests/Unit/Model/SectionCollectionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void check_section_data_operations()
SectionCollection sdc = new SectionCollection();
Assert.That(sdc, Is.Empty);

//Add sectoin
//Add section
sdc.Add(strSectionTest);
sdc.Add(strSectionTest);
Assert.That(sdc.Count, Is.EqualTo(1));
Expand All @@ -31,7 +31,7 @@ public void check_section_data_operations()
Assert.That(sdc.FindByName(strSectionTest).Comments, Is.Empty);
Assert.That(sdc.FindByName(strSectionTest).Properties.Count, Is.EqualTo(0));

//Check add coments
//Check add comments
sdc.FindByName(strSectionTest).Comments.Add(strComment);
Assert.That(sdc.FindByName(strSectionTest).Comments.Count, Is.EqualTo(1));
sdc.FindByName(strSectionTest).Comments.Clear();
Expand Down
8 changes: 4 additions & 4 deletions src/IniParser.Tests/Unit/Parser/ParserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,17 +226,17 @@ public void check_can_parse_special_characters_in_section_names()
public void allow_whitespace_in_section_names()
{
string data =
@"[Web Colaboration]
@"[Web Collaboration]
key = value";

var parser = new IniDataParser();

IniData iniData = parser.Parse(data);

Assert.That(iniData.Sections.Count, Is.EqualTo(1));
Assert.That(iniData.Sections.Contains("Web Colaboration"), Is.True);
Assert.That(iniData.Sections["Web Colaboration"].Contains("key"), Is.True);
Assert.That(iniData.Sections["Web Colaboration"]["key"], Is.EqualTo("value"));
Assert.That(iniData.Sections.Contains("Web Collaboration"), Is.True);
Assert.That(iniData.Sections["Web Collaboration"].Contains("key"), Is.True);
Assert.That(iniData.Sections["Web Collaboration"]["key"], Is.EqualTo("value"));
}

[Test]
Expand Down
6 changes: 3 additions & 3 deletions src/IniParser/Configuration/IniParserConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ namespace IniParser.Configuration
/// With a configuration object you can redefine how the parser
/// will detect special items in the ini file by defining new regex
/// (e.g. you can redefine the comment regex so it just treat text as
/// a comment iff the comment caracter is the first in the line)
/// a comment iff the comment character is the first in the line)
/// or changing the set of characters used to define elements in
/// the ini file (e.g. change the 'comment' caracter from ';' to '#')
/// the ini file (e.g. change the 'comment' character from ';' to '#')
/// You can also define how the parser should treat errors, or how liberal
/// or conservative should it be when parsing files with "strange" formats.
public class IniParserConfiguration : IDeepCloneable<IniParserConfiguration>
Expand Down Expand Up @@ -51,7 +51,7 @@ public IniParserConfiguration()
public bool CaseInsensitive { get; set; } = false;

/// <summary>
/// Allows having keys at the begining of the file, before any section
/// Allows having keys at the beginning of the file, before any section
/// is defined. Those keys don't belong to any section and are stored in
/// the <see cref="IniData.Global"/> special field.
/// If set to false and the ini file contains keys outside a section,
Expand Down
6 changes: 3 additions & 3 deletions src/IniParser/Configuration/IniScheme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class IniScheme : IDeepCloneable<IniScheme>
/// Ctor.
/// </summary>
/// <remarks>
/// By default the various delimiters for the data are setted:
/// By default the various delimiters for the data are set:
/// <para>';' for one-line comments</para>
/// <para>'[' ']' for delimiting a section</para>
/// <para>'=' for linking key / value pairs</para>
Expand Down Expand Up @@ -51,7 +51,7 @@ public IniScheme()

/// <summary>
/// Sets the string that defines the start of a comment.
/// A comment spans from the mirst matching comment string
/// A comment spans from the first matching comment string
/// to the end of the line.
/// </summary>
/// <remarks>
Expand Down Expand Up @@ -93,7 +93,7 @@ public string SectionEndString


/// <summary>
/// Sets the string used in the ini file to denote a key / value assigment
/// Sets the string used in the ini file to denote a key / value assignment
/// </summary>
/// <remarks>
/// Defaults to character '='
Expand Down
2 changes: 1 addition & 1 deletion src/IniParser/Exceptions/ParsingException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace IniParser.Exceptions
{
/// <summary>
/// Represents an error ococcurred while parsing data
/// Represents an error occurred while parsing data
/// </summary>
public class ParsingException : Exception
{
Expand Down
4 changes: 2 additions & 2 deletions src/IniParser/IniData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public IniData()
}

/// <summary>
/// Initialzes an IniData instance with a given scheme
/// Initializes an IniData instance with a given scheme
/// </summary>
/// <param name="scheme"></param>
public IniData(IniScheme scheme)
Expand All @@ -40,7 +40,7 @@ public IniData(IniData ori)

/// <summary>
/// If set to true, it will automatically create a section when you use the indexed
/// access with a section name that does not exis.
/// access with a section name that does not exist.
/// If set to false, it will throw an exception if you try to access a section that
/// does not exist with the index operator.
/// </summary>
Expand Down
24 changes: 12 additions & 12 deletions src/IniParser/IniDataParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
namespace IniParser
{
/// <summary>
/// Responsible for parsing an string from an ini file, and creating
/// an <see cref="IniData"/> structure.
/// </summary>
/// Responsible for parsing an string from an ini file, and creating
/// an <see cref="IniData"/> structure.
/// </summary>
public partial class IniDataParser
{
#region Initialization
Expand Down Expand Up @@ -73,10 +73,10 @@ public IniData Parse(string iniString)
/// Parses a string containing valid ini data
/// </summary>
/// <param name="textReader">
/// Text reader for the source string contaninig the ini data
/// Text reader for the source string containing the ini data
/// </param>
/// <returns>
/// An <see cref="IniData"/> instance containing the data readed
/// An <see cref="IniData"/> instance containing the data read
/// from the source
/// </returns>
/// <exception cref="ParsingException">
Expand All @@ -97,10 +97,10 @@ public IniData Parse(TextReader textReader)
/// Parses a string containing valid ini data
/// </summary>
/// <param name="textReader">
/// Text reader for the source string contaninig the ini data
/// Text reader for the source string containing the ini data
/// </param>
/// <returns>
/// An <see cref="IniData"/> instance containing the data readed
/// An <see cref="IniData"/> instance containing the data read
/// from the source
/// </returns>
/// <exception cref="ParsingException">
Expand Down Expand Up @@ -142,7 +142,7 @@ public void Parse(TextReader textReader, ref IniData iniData)
// TODO: is this try necessary?
try
{
// Orphan comments, assing to last section/key value
// Orphan comments, assign to last section/key value
if (Configuration.ParseComments && CurrentCommentListTemp.Count > 0)
{
if (iniData.Sections.Count > 0)
Expand Down Expand Up @@ -242,7 +242,7 @@ protected virtual bool ProcessComment(StringBuffer currentLine)
currentLineTrimmed.TrimEnd();

var commentRange = currentLineTrimmed.FindSubstring(Scheme.CommentString);
// Exctract the range of the string that contains the comment but not
// Extract the range of the string that contains the comment but not
// the comment delimiter
var startIdx = commentRange.start + Scheme.CommentString.Length;
var size = currentLineTrimmed.Count - Scheme.CommentString.Length;
Expand All @@ -260,7 +260,7 @@ protected virtual bool ProcessComment(StringBuffer currentLine)
}

/// <summary>
/// Proccess a string which contains an ini section.%
/// Process a string which contains an ini section.%
/// </summary>
/// <param name="currentLine">
/// The string to be processed
Expand Down Expand Up @@ -482,7 +482,7 @@ private void AddKeyToKeyValueCollection(string key, string value, PropertyCollec
#region Fields
uint _currentLineNumber;

// Holds a list of the exceptions catched while parsing
// Holds a list of the exceptions caught while parsing
readonly List<Exception> _errorExceptions;

// Temp list of comments
Expand All @@ -505,7 +505,7 @@ internal set
}
List<string> _currentCommentListTemp;

// Tmp var with the name of the seccion which is being process
// Temporary var with the name of the section which is being process
string _currentSectionNameTemp;

// Buffer used to hold the current line being processed.
Expand Down
2 changes: 1 addition & 1 deletion src/IniParser/Model/IDeepCloneable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/// copied too instead of copying the reference.
/// </summary>
/// <typeparam name="T"></typeparam>
public interface IDeepCloneable<T> where T : class
public interface IDeepCloneable<T> where T : class
{
T DeepClone();
}
Expand Down
2 changes: 1 addition & 1 deletion src/IniParser/Model/Property.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public Property(Property ori)

/// <summary>
/// Gets or sets the comment list associated to this property.
/// Makes a copy og the values when set
/// Makes a copy of the values when set
/// </summary>
public List<string> Comments
{
Expand Down
6 changes: 3 additions & 3 deletions src/IniParser/Model/PropertyCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public PropertyCollection(PropertyCollection ori, IEqualityComparer<string> sear
/// </summary>
/// <remarks>
/// If we try to assign the value of a property which doesn't exists,
/// a new one is added with the kay and the value specified
/// a new one is added with the key and the value specified
/// </remarks>
/// <param name="keyName">
/// key of the property
Expand Down Expand Up @@ -182,7 +182,7 @@ public void ClearComments()
/// Key name to search
/// </param>
/// <returns>
/// true if a property with the givne exists in the collectoin
/// true if a property with the given exists in the collection
/// false otherwise
/// </returns>
public bool Contains(string keyName)
Expand Down Expand Up @@ -248,7 +248,7 @@ public bool Remove(string keyName)
#region IEnumerable<KeyData> Members

/// <summary>
/// Allows iteration througt the collection.
/// Allows iteration through the collection.
/// </summary>
/// <returns>A strong-typed IEnumerator </returns>
public IEnumerator<Property> GetEnumerator()
Expand Down