CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
via_header_value.h
1
2#pragma once
3
4#include <cstdint>
5#include <system/icloneable.h>
6#include <system/object.h>
7#include <system/shared_ptr.h>
8#include <system/string.h>
9
10namespace System { namespace Net { namespace Http { namespace Headers {
11
16class ASPOSECPP_SHARED_CLASS ViaHeaderValue : public System::ICloneable
17{
22
24 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
26 ASPOSECPP_SHARED_RTTI_INFO_DECL();
27
28public:
31 ASPOSECPP_SHARED_API String get_ProtocolName();
34 ASPOSECPP_SHARED_API String get_ProtocolVersion();
37 ASPOSECPP_SHARED_API String get_ReceivedBy();
40 ASPOSECPP_SHARED_API String get_Comment();
41
45 ASPOSECPP_SHARED_API ViaHeaderValue(String protocolVersion, String receivedBy);
50 ASPOSECPP_SHARED_API ViaHeaderValue(String protocolVersion, String receivedBy, String protocolName);
56 ASPOSECPP_SHARED_API ViaHeaderValue(String protocolVersion, String receivedBy, String protocolName, String comment);
57
59 ASPOSECPP_SHARED_API String ToString() const override;
61 ASPOSECPP_SHARED_API bool Equals(System::SharedPtr<Object> obj) override;
63 ASPOSECPP_SHARED_API int32_t GetHashCode() const override;
67 ASPOSECPP_SHARED_API static System::SharedPtr<ViaHeaderValue> Parse(String input);
72 ASPOSECPP_SHARED_API static bool TryParse(String input, System::SharedPtr<ViaHeaderValue>& parsedValue);
78 ASPOSECPP_SHARED_API static int32_t GetViaLength(String input, int32_t startIndex, System::SharedPtr<Object>& parsedValue);
79
80private:
82 String _protocolName;
84 String _protocolVersion;
86 String _receivedBy;
88 String _comment;
89
92 MEMBER_FUNCTION_MAKE_OBJECT(ViaHeaderValue, CODEPORTING_ARGS(), CODEPORTING_ARGS());
96 MEMBER_FUNCTION_MAKE_OBJECT(ViaHeaderValue, CODEPORTING_ARGS(System::SharedPtr<ViaHeaderValue> source), CODEPORTING_ARGS(source));
97
104 static int32_t GetProtocolEndIndex(String input, int32_t startIndex, String& protocolName, String& protocolVersion);
106 System::SharedPtr<Object> Clone() override;
111 static void CheckReceivedBy(String receivedBy);
112};
113
114}}}} // 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 value of the 'Via' header. Objects of this class should only be allocated using System::...
Definition: via_header_value.h:17
static bool TryParse(String input, System::SharedPtr< ViaHeaderValue > &parsedValue)
Tries to convert a passed string to an instance of the ViaHeaderValue class.
int32_t GetHashCode() const override
Analog of C# Object.GetHashCode() method. Enables hashing of custom objects.
static int32_t GetViaLength(String input, int32_t startIndex, System::SharedPtr< Object > &parsedValue)
Converts a passed string from the specified index to an instance of the ViaHeaderValue class.
String ToString() const override
Analog of C# Object.ToString() method. Enables converting custom objects to string.
ViaHeaderValue(String protocolVersion, String receivedBy, String protocolName, String comment)
Constructs a new instance.
String get_Comment()
Returns the comment from the 'Via' header value.
bool Equals(System::SharedPtr< Object > obj) override
Compares objects using C# Object.Equals semantics.
ViaHeaderValue(String protocolVersion, String receivedBy)
Constructs a new instance.
static System::SharedPtr< ViaHeaderValue > Parse(String input)
Converts a passed string to an instance of the ViaHeaderValue class.
String get_ProtocolName()
Returns the protocol name from the 'Via' header value.
ViaHeaderValue(String protocolVersion, String receivedBy, String protocolName)
Constructs a new instance.
String get_ProtocolVersion()
Returns the protocol version from the 'Via' header value.
String get_ReceivedBy()
Returns the host and port that the request or response was received by.
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
Definition: db_command.h:9