/// <summary> /// Quotes any values containing comas, and then coma joins all of the values. /// </summary> /// <param name="key">The header name.</param> /// <param name="values">The header values.</param> public void SetCommaSeparatedValues(string key, params string[] values) { ParsingHelpers.SetHeaderJoined(Store, key, values); }
/// <summary> /// Sets a specific header value. /// </summary> /// <param name="key">The header name.</param> /// <param name="value">The header value.</param> public void Set(string key, string value) { ParsingHelpers.SetHeader(Store, key, value); }
/// <summary> /// Sets the specified header values without modification. /// </summary> /// <param name="key">The header name.</param> /// <param name="values">The header values.</param> public void SetValues(string key, params string[] values) { ParsingHelpers.SetHeaderUnmodified(Store, key, values); }
/// <summary> /// Add new values. Each item remains a separate array entry. /// </summary> /// <param name="key">The header name.</param> /// <param name="values">The header values.</param> public void AppendValues(string key, params string[] values) { ParsingHelpers.AppendHeaderUnmodified(Store, key, values); }
/// <summary> /// Add a new value. Appends to the header if already present /// </summary> /// <param name="key">The header name.</param> /// <param name="value">The header value.</param> public void Append(string key, string value) { ParsingHelpers.AppendHeader(Store, key, value); }
/// <summary> /// Get the associated values from the collection separated into individual values. /// Quoted values will not be split, and the quotes will be removed. /// </summary> /// <param name="key">The header name.</param> /// <returns>the associated values from the collection separated into individual values, or null if the key is not present.</returns> public IList <string> GetCommaSeparatedValues(string key) { IEnumerable <string> values = ParsingHelpers.GetHeaderSplit(Store, key); return(values == null ? null : values.ToList()); }
/// <summary> /// Get the associated values from the collection without modification. /// </summary> /// <param name="key">The header name.</param> /// <returns>the associated value from the collection without modification, or null if the key is not present.</returns> public IList <string> GetValues(string key) { return(ParsingHelpers.GetHeaderUnmodified(Store, key)); }
///// <summary> ///// Returns an enumerator that iterates through a collection. ///// </summary> ///// <returns>An <see cref="T:System.Collections.IEnumerator" /> object that can be used to iterate through the collection.</returns> //IEnumerator IEnumerable.GetEnumerator() //{ // return GetEnumerator(); //} /// <summary> /// Get the associated value from the collection as a single string. /// </summary> /// <param name="key">The header name.</param> /// <returns>the associated value from the collection as a single string or null if the key is not present.</returns> public string Get(string key) { return(ParsingHelpers.GetHeader(Store, key)); }