CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
media_type_header_value.h
1
2#pragma once
3
4#include <cstdint>
5#include <system/collections/icollection.h>
6#include <system/icloneable.h>
7#include <system/object.h>
8#include <system/shared_ptr.h>
9#include <system/string.h>
10
11#include <net/http/headers/name_value_header_value.h>
12#include <net/http/headers/object_collection.h>
13
14namespace System { namespace Net { namespace Http { namespace Headers {
15
20class ASPOSECPP_SHARED_CLASS MediaTypeHeaderValue : public virtual System::ICloneable
21{
26
28 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
30 ASPOSECPP_SHARED_RTTI_INFO_DECL();
31
32public:
35 ASPOSECPP_SHARED_API String get_CharSet();
38 ASPOSECPP_SHARED_API void set_CharSet(String value);
45 ASPOSECPP_SHARED_API String get_MediaType();
48 ASPOSECPP_SHARED_API void set_MediaType(String value);
49
51 ASPOSECPP_SHARED_API MediaTypeHeaderValue();
54 ASPOSECPP_SHARED_API MediaTypeHeaderValue(String mediaType);
55
57 ASPOSECPP_SHARED_API String ToString() const override;
59 ASPOSECPP_SHARED_API bool Equals(System::SharedPtr<Object> obj) override;
61 ASPOSECPP_SHARED_API int32_t GetHashCode() const override;
65 ASPOSECPP_SHARED_API static System::SharedPtr<MediaTypeHeaderValue> Parse(String input);
70 ASPOSECPP_SHARED_API static bool TryParse(String input, System::SharedPtr<MediaTypeHeaderValue>& parsedValue);
77 ASPOSECPP_SHARED_API static int32_t GetMediaTypeLength(String input, int32_t startIndex,
80
81protected:
85 MEMBER_FUNCTION_MAKE_OBJECT(MediaTypeHeaderValue, CODEPORTING_ARGS(System::SharedPtr<MediaTypeHeaderValue> source), CODEPORTING_ARGS(source));
86
87private:
89 static const String charSet;
93 String _mediaType;
94
96 static int32_t GetMediaTypeExpressionLength(String input, int32_t startIndex, String& mediaType);
98 static void CheckMediaTypeFormat(String mediaType, String parameterName);
100 System::SharedPtr<Object> Clone() override;
101};
102
103}}}} // namespace System::Net::Http::Headers
Defies a method that enables object cloning - creating a copy of an object. Objects of this class sho...
Definition: icloneable.h:16
Represents a MIME type in a value of the 'Content-Type' header. Objects of this class should only be ...
Definition: media_type_header_value.h:21
MediaTypeHeaderValue(String mediaType)
Constructs a new instance.
static bool TryParse(String input, System::SharedPtr< MediaTypeHeaderValue > &parsedValue)
Tries to convert a passed string to an instance of the MediaTypeHeaderValue class.
static int32_t GetMediaTypeLength(String input, int32_t startIndex, HeaderFunc< System::SharedPtr< MediaTypeHeaderValue > > mediaTypeCreator, System::SharedPtr< MediaTypeHeaderValue > &parsedValue)
Converts a passed string from the specified index to an instance of the MediaTypeHeaderValue class.
void set_CharSet(String value)
Sets a character set.
MediaTypeHeaderValue()
Constructs a new instance.
String get_CharSet()
Gets a character set.
MediaTypeHeaderValue(System::SharedPtr< MediaTypeHeaderValue > source)
The copy constructor.
System::SharedPtr< Collections::Generic::ICollection< System::SharedPtr< NameValueHeaderValue > > > get_Parameters()
Returns the value parameters of the media-type header.
int32_t GetHashCode() const override
Analog of C# Object.GetHashCode() method. Enables hashing of custom objects.
void set_MediaType(String value)
Sets a value of the media-type header.
bool Equals(System::SharedPtr< Object > obj) override
Compares objects using C# Object.Equals semantics.
static System::SharedPtr< MediaTypeHeaderValue > Parse(String input)
Converts a passed string to an instance of the MediaTypeHeaderValue class.
String get_MediaType()
Gets a value of the media-type header.
String ToString() const override
Analog of C# Object.ToString() method. Enables converting custom objects to string.
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
System::MulticastDelegate< TResult()> HeaderFunc
Definition: http_headers.h:24
Definition: db_command.h:9