Class Map
A ordered map of System.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 |
---|---|
System.Int32 |
See Also
Item[String]
Accesses the Value at key
in the map.
Declaration
public Value this[string key] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.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 |
---|---|
System.Collections.Generic.ICollection<System.String> |
See Also
Values
Gets a collection of the values in the Map.
Declaration
public ICollection<Value> Values { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.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 |
---|---|---|
System.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 |
---|---|---|
System.String | key | the key to check for |
Returns
Type | Description |
---|---|
System.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 |
---|---|
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<System.String, Value>> | an System.Collections.Generic.IEnumerator<T> of key-value pairs in this Map |
See Also
Remove(String)
Removes the object associated with a key in this Map.
Declaration
public bool Remove(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | the key to remove |
Returns
Type | Description |
---|---|
System.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 |
---|---|
System.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 |
---|---|---|
System.String | key | the key of the value to get |
Value | value | the target location of the retrieved object |
Returns
Type | Description |
---|---|
System.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 |
---|---|---|
System.Collections.Generic.KeyValuePair<System.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 |
---|---|---|
System.Collections.Generic.KeyValuePair<System.String, Value> | item |
Returns
Type | Description |
---|---|
System.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 |
---|---|---|
System.Collections.Generic.KeyValuePair<System.String, Value>[] | array | |
System.Int32 | arrayIndex |
ICollection<KeyValuePair<String, Value>>.IsReadOnly
Declaration
bool ICollection<KeyValuePair<string, Value>>.IsReadOnly { get; }
Returns
Type | Description |
---|---|
System.Boolean |
ICollection<KeyValuePair<String, Value>>.Remove(KeyValuePair<String, Value>)
Declaration
bool ICollection<KeyValuePair<string, Value>>.Remove(KeyValuePair<string, Value> item)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.KeyValuePair<System.String, Value> | item |
Returns
Type | Description |
---|---|
System.Boolean |
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |