Class Map
A ordered map of String to Value for serialization by an IConfigProvider. Use Map() or From(IDictionary<String, Value>) to create.
Implements
Inherited Members
Namespace: IPA.Config.Data
Assembly: IPA.Loader.dll
Syntax
public sealed class Map : Value, IDictionary<string, Value>, ICollection<KeyValuePair<string, Value>>, IEnumerable<KeyValuePair<string, Value>>, IEnumerable
Properties
| Improve this Doc View SourceCount
Gets the number of key-value pairs in this Map.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
Int32 |
See Also
| Improve this Doc View SourceItem[String]
Accesses the Value at key
in the map.
Declaration
public Value this[string key] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
String | key | the key to get the value associated with |
Property Value
Type | Description |
---|---|
Value | the value associated with the |
See Also
Keys
Gets a collection of the keys for the Map.
Declaration
public ICollection<string> Keys { get; }
Property Value
Type | Description |
---|---|
ICollection<String> |
See Also
| Improve this Doc View SourceValues
Gets a collection of the values in the Map.
Declaration
public ICollection<Value> Values { get; }
Property Value
Type | Description |
---|---|
ICollection<Value> |
Remarks
Unlike all other iterables given by Map, this does not guarantee that order is maintained.
See Also
Methods
| Improve this Doc View SourceAdd(String, Value)
Adds a new Value with a given key.
Declaration
public void Add(string key, Value value)
Parameters
Type | Name | Description |
---|---|---|
String | key | the key to put the value at |
Value | value | the Value to add |
See Also
Clear()
Clears the Map of its key-value pairs.
Declaration
public void Clear()
See Also
ContainsKey(String)
Checks if the Map contains a given key
.
Declaration
public bool ContainsKey(string key)
Parameters
Type | Name | Description |
---|---|---|
String | key | the key to check for |
Returns
Type | Description |
---|---|
Boolean | true if the key exists, otherwise false |
See Also
GetEnumerator()
Enumerates the Map's key-value pairs.
Declaration
public IEnumerator<KeyValuePair<string, Value>> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<KeyValuePair<String, Value>> | an IEnumerator<T> of key-value pairs in this Map |
See Also
| Improve this Doc View SourceRemove(String)
Removes the object associated with a key in this Map.
Declaration
public bool Remove(string key)
Parameters
Type | Name | Description |
---|---|---|
String | key | the key to remove |
Returns
Type | Description |
---|---|
Boolean | true if the key existed, false otherwise |
See Also
ToString()
Converts this Value into a human-readable format.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | a JSON-like set of key-value pairs |
Overrides
| Improve this Doc View SourceTryGetValue(String, out Value)
Gets the value associated with the specified key.
Declaration
public bool TryGetValue(string key, out Value value)
Parameters
Type | Name | Description |
---|---|---|
String | key | the key of the value to get |
Value | value | the target location of the retrieved object |
Returns
Type | Description |
---|---|
Boolean | true if the key was found and |
See Also
Explicit Interface Implementations
| Improve this Doc View SourceICollection<KeyValuePair<String, Value>>.Add(KeyValuePair<String, Value>)
Declaration
void ICollection<KeyValuePair<string, Value>>.Add(KeyValuePair<string, Value> item)
Parameters
Type | Name | Description |
---|---|---|
KeyValuePair<String, Value> | item |
ICollection<KeyValuePair<String, Value>>.Contains(KeyValuePair<String, Value>)
Declaration
bool ICollection<KeyValuePair<string, Value>>.Contains(KeyValuePair<string, Value> item)
Parameters
Type | Name | Description |
---|---|---|
KeyValuePair<String, Value> | item |
Returns
Type | Description |
---|---|
Boolean |
ICollection<KeyValuePair<String, Value>>.CopyTo(KeyValuePair<String, Value>[], Int32)
Declaration
void ICollection<KeyValuePair<string, Value>>.CopyTo(KeyValuePair<string, Value>[] array, int arrayIndex)
Parameters
Type | Name | Description |
---|---|---|
KeyValuePair<String, Value>[] | array | |
Int32 | arrayIndex |
ICollection<KeyValuePair<String, Value>>.IsReadOnly
Declaration
bool ICollection<KeyValuePair<string, Value>>.IsReadOnly { get; }
Returns
Type | Description |
---|---|
Boolean |
ICollection<KeyValuePair<String, Value>>.Remove(KeyValuePair<String, Value>)
Declaration
bool ICollection<KeyValuePair<string, Value>>.Remove(KeyValuePair<string, Value> item)
Parameters
Type | Name | Description |
---|---|---|
KeyValuePair<String, Value> | item |
Returns
Type | Description |
---|---|
Boolean |
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator |