My Project
Loading...
Searching...
No Matches
Public Member Functions | Properties | List of all members
IniParser.Model.KeyDataCollection Class Reference
Inheritance diagram for IniParser.Model.KeyDataCollection:

Public Member Functions

 KeyDataCollection ()
 Initializes a new instance of the KeyDataCollection class.
 
 KeyDataCollection (KeyDataCollection ori)
 Initializes a new instance of the KeyDataCollection class from a previous instance of KeyDataCollection.
 
bool AddKey (string keyName)
 Adds a new key with the specified name and empty value and comments.
 
bool AddKey (string keyName, KeyData keyData)
 Adds a new key with the specified name and value and comments.
 
bool AddKey (string keyName, string keyValue)
 Adds a new key with the specified name and value and comments.
 
void ClearComments ()
 Clears all comments of this section.
 
bool ContainsKey (string keyName)
 Gets if a specifyed key name exists in the collection.
 
KeyData GetKeyData (string keyName)
 Retrieves the data for a specified key given its name.
 
void Merge (KeyDataCollection keyDataToMerge)
 
void RemoveAllKeys ()
 Deletes all keys in this collection.
 
bool RemoveKey (string keyName)
 Deletes a previously existing key, including its associated data.
 
void SetKeyData (KeyData data)
 Sets the key data associated to a specified key.
 
IEnumerator< KeyDataGetEnumerator ()
 Allows iteration througt the collection.
 
object Clone ()
 Creates a new object that is a copy of the current instance.
 

Properties

string this[string keyName] [get, set]
 
int Count [get]
 Return the number of keys in the collection.
 

Detailed Description

Represents a collection of Keydata.

Constructor & Destructor Documentation

◆ KeyDataCollection()

IniParser.Model.KeyDataCollection.KeyDataCollection ( KeyDataCollection  ori)
inline

Initializes a new instance of the KeyDataCollection class from a previous instance of KeyDataCollection.

Data is deeply copied

Parameters
oriThe instance of the KeyDataCollection class used to create the new instance.

Member Function Documentation

◆ AddKey() [1/3]

bool IniParser.Model.KeyDataCollection.AddKey ( string  keyName)
inline

Adds a new key with the specified name and empty value and comments.

A valid key name is a string with NO blank spaces.

Parameters
keyNameNew key to be added.
Returns
true if a new empty key was added false otherwise.
Exceptions
ArgumentExceptionIf the key name is not valid.

◆ AddKey() [2/3]

bool IniParser.Model.KeyDataCollection.AddKey ( string  keyName,
KeyData  keyData 
)
inline

Adds a new key with the specified name and value and comments.

A valid key name is a string with NO blank spaces.

Parameters
keyNameNew key to be added.
keyDataKeyData instance.
Returns
true if a new empty key was added false otherwise.
Exceptions
ArgumentExceptionIf the key name is not valid.

◆ AddKey() [3/3]

bool IniParser.Model.KeyDataCollection.AddKey ( string  keyName,
string  keyValue 
)
inline

Adds a new key with the specified name and value and comments.

A valid key name is a string with NO blank spaces.

Parameters
keyNameNew key to be added.
keyValueValue associated to the kyy.
Returns
true if a new empty key was added false otherwise.
Exceptions
ArgumentExceptionIf the key name is not valid.

◆ Clone()

object IniParser.Model.KeyDataCollection.Clone ( )
inline

Creates a new object that is a copy of the current instance.

Returns
A new object that is a copy of this instance.

◆ ContainsKey()

bool IniParser.Model.KeyDataCollection.ContainsKey ( string  keyName)
inline

Gets if a specifyed key name exists in the collection.

Parameters
keyNameKey name to search
Returns
true if a key with the specified name exists in the collectoin false otherwise

◆ GetEnumerator()

IEnumerator< KeyData > IniParser.Model.KeyDataCollection.GetEnumerator ( )
inline

Allows iteration througt the collection.

Returns
A strong-typed IEnumerator

◆ GetKeyData()

KeyData IniParser.Model.KeyDataCollection.GetKeyData ( string  keyName)
inline

Retrieves the data for a specified key given its name.

Parameters
keyNameName of the key to retrieve.
Returns
A KeyData instance holding the key information or null if the key wasn't found.

◆ RemoveKey()

bool IniParser.Model.KeyDataCollection.RemoveKey ( string  keyName)
inline

Deletes a previously existing key, including its associated data.

Parameters
keyNameThe key to be removed.
Returns
true if a key with the specified name was removed false otherwise.

◆ SetKeyData()

void IniParser.Model.KeyDataCollection.SetKeyData ( KeyData  data)
inline

Sets the key data associated to a specified key.

Parameters
dataThe new KeyData for the key.

Property Documentation

◆ Count

int IniParser.Model.KeyDataCollection.Count
get

Return the number of keys in the collection.

An integer with the number of keys in the collection.

◆ this[string keyName]

string IniParser.Model.KeyDataCollection.this[string keyName]
getset

Gets or sets the value of a concrete key.

If we try to assign the value of a key which doesn't exists, a new key is added with the name and the value is assigned to it.

Parameters
keyNameName of the key
Returns
The string with key's value or null if the key was not found.

The documentation for this class was generated from the following file: