System::Net::Http::Headers::HttpHeaderValueCollection class

HttpHeaderValueCollection class

表示标头值的集合。此类的对象应仅使用 System::MakeObject() 函数分配。切勿在栈上或使用 operator new 创建此类型的实例,因为这会导致运行时错误和/或断言故障。始终将此类包装到 System::SmartPtr 指针中,并使用该指针将其作为参数传递给函数。

template<typename T>class HttpHeaderValueCollection : public System::Collections::Generic::ICollection<T>
参数描述
集合中表示的标头值的类型。

方法

方法描述
Add(const T&) override向集合中添加元素。
Clear() override删除集合中的所有元素。
Contains(const T&) const override检查集合中是否存在该元素。
CopyTo(System::ArrayPtr<T>, int32_t) override将所有集合元素复制到现有数组元素中。
get_Count() const overrideRTTI 信息。
get_IsReadOnly()获取一个值,指示当前集合是否为只读。
get_IsSpecialValueSet()获取一个值,指示当前集合是否包含 “特殊值”。
GetEnumerator() override获取枚举器。
GetHeaderStringWithoutSpecial()返回当前集合的字符串表示,不包含 “特殊值”。
HttpHeaderValueCollection(String, System::SharedPtr<HttpHeaders>)构造一个新实例。
HttpHeaderValueCollection(String, System::SharedPtr<HttpHeaders>, Action<System::SharedPtr<HttpHeaderValueCollection<T>>, T>)构造一个新实例。
HttpHeaderValueCollection(String, System::SharedPtr<HttpHeaders>, T)构造一个新实例。
HttpHeaderValueCollection(String, System::SharedPtr<HttpHeaders>, T, Action<System::SharedPtr<HttpHeaderValueCollection<T>>, T>)构造一个新实例。
ParseAdd(String)解析标头字符串表示并将其添加到当前集合。
Remove(const T&) override从集合中删除元素。
RemoveSpecialValue()移除 “特殊值”。
SetSpecialValue()设置 “特殊值”。
SetTemplateWeakPtr(uint32_t) override将第 n 个模板参数设置为弱指针(而不是共享指针)。允许在容器中将指针切换为弱模式。
ToString() const override相当于 C# 的 Object.ToString() 方法。用于将自定义对象转换为字符串。
TryParseAdd(String)尝试解析标头字符串表示并将其添加到当前集合。

另见