CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
http_method.h
1
2#pragma once
3
4#include <cstdint>
5#include <system/iequatable.h>
6#include <system/object.h>
7#include <system/shared_ptr.h>
8#include <system/string.h>
9
10namespace System { namespace Net { namespace Http {
11
16class ASPOSECPP_SHARED_CLASS HttpMethod : public System::IEquatable<System::SharedPtr<System::Net::Http::HttpMethod>>
17{
19 typedef HttpMethod ThisType;
22
24 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
26 ASPOSECPP_SHARED_RTTI_INFO_DECL();
27
30
31public:
34 ASPOSECPP_SHARED_API static System::SharedPtr<HttpMethod> get_Get();
37 ASPOSECPP_SHARED_API static System::SharedPtr<HttpMethod> get_Put();
40 ASPOSECPP_SHARED_API static System::SharedPtr<HttpMethod> get_Post();
43 ASPOSECPP_SHARED_API static System::SharedPtr<HttpMethod> get_Delete();
46 ASPOSECPP_SHARED_API static System::SharedPtr<HttpMethod> get_Head();
49 ASPOSECPP_SHARED_API static System::SharedPtr<HttpMethod> get_Options();
52 ASPOSECPP_SHARED_API static System::SharedPtr<HttpMethod> get_Trace();
55 ASPOSECPP_SHARED_API String get_Method();
56
59 ASPOSECPP_SHARED_API HttpMethod(String method);
60
62 ASPOSECPP_SHARED_API bool Equals(System::SharedPtr<HttpMethod> other) override;
64 ASPOSECPP_SHARED_API bool Equals(System::SharedPtr<Object> obj) override;
66 ASPOSECPP_SHARED_API int32_t GetHashCode() const override;
68 ASPOSECPP_SHARED_API String ToString() const override;
69
70private:
72 String _method;
74 mutable int32_t _hashcode;
76 static System::SharedPtr<HttpMethod> s_getMethod;
78 static System::SharedPtr<HttpMethod> s_putMethod;
80 static System::SharedPtr<HttpMethod> s_postMethod;
82 static System::SharedPtr<HttpMethod> s_deleteMethod;
84 static System::SharedPtr<HttpMethod> s_headMethod;
86 static System::SharedPtr<HttpMethod> s_optionsMethod;
88 static System::SharedPtr<HttpMethod> s_traceMethod;
89
93 static bool IsUpperAscii(String value);
94};
95
98
99}}} // namespace System::Net::Http
Defines a method that determines the equality of two objects. Objects of this class should only be al...
Definition: iequatable.h:16
Represents an HTTP method. Objects of this class should only be allocated using System::MakeObject() ...
Definition: http_method.h:17
String ToString() const override
Analog of C# Object.ToString() method. Enables converting custom objects to string.
friend bool operator!=(System::SharedPtr< HttpMethod > left, System::SharedPtr< HttpMethod > right)
static System::SharedPtr< HttpMethod > get_Head()
Returns the 'HEAD' HTTP method.
friend bool operator==(System::SharedPtr< HttpMethod > left, System::SharedPtr< HttpMethod > right)
static System::SharedPtr< HttpMethod > get_Delete()
Returns the 'DELETE' HTTP method.
int32_t GetHashCode() const override
Analog of C# Object.GetHashCode() method. Enables hashing of custom objects.
bool Equals(System::SharedPtr< HttpMethod > other) override
Determines if the the current and specified objects are equal.
bool Equals(System::SharedPtr< Object > obj) override
Compares objects using C# Object.Equals semantics.
static System::SharedPtr< HttpMethod > get_Get()
Returns the 'GET' HTTP method.
static System::SharedPtr< HttpMethod > get_Post()
Returns the 'POST' HTTP method.
static System::SharedPtr< HttpMethod > get_Put()
Returns the 'PUT' HTTP method.
static System::SharedPtr< HttpMethod > get_Options()
Returns the 'OPTIONS' HTTP method.
String get_Method()
Returns a string representation of the HTTP method.
static System::SharedPtr< HttpMethod > get_Trace()
Returns the 'TRACE' HTTP method.
HttpMethod(String method)
Constructs a new instance.
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
bool operator!=(System::SharedPtr< HttpMethod > left, System::SharedPtr< HttpMethod > right)
bool operator==(System::SharedPtr< HttpMethod > left, System::SharedPtr< HttpMethod > right)
Definition: db_command.h:9