CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
product_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 ProductHeaderValue : 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_Name();
34 ASPOSECPP_SHARED_API String get_Version();
35
38 ASPOSECPP_SHARED_API ProductHeaderValue(String name);
42 ASPOSECPP_SHARED_API ProductHeaderValue(String name, String version);
43
45 ASPOSECPP_SHARED_API String ToString() const override;
47 ASPOSECPP_SHARED_API bool Equals(System::SharedPtr<Object> obj) override;
49 ASPOSECPP_SHARED_API int32_t GetHashCode() const override;
53 ASPOSECPP_SHARED_API static System::SharedPtr<ProductHeaderValue> Parse(String input);
58 ASPOSECPP_SHARED_API static bool TryParse(String input, System::SharedPtr<ProductHeaderValue>& parsedValue);
64 ASPOSECPP_SHARED_API static int32_t GetProductLength(String input, int32_t startIndex,
66
67private:
69 String _name;
71 String _version;
72
76 MEMBER_FUNCTION_MAKE_OBJECT(ProductHeaderValue, CODEPORTING_ARGS(System::SharedPtr<ProductHeaderValue> source), CODEPORTING_ARGS(source));
77
80 MEMBER_FUNCTION_MAKE_OBJECT(ProductHeaderValue, CODEPORTING_ARGS(), CODEPORTING_ARGS());
81
83 System::SharedPtr<Object> Clone() override;
84};
85
86}}}} // 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 product token in a value of the 'User-Agent' header. Objects of this class should only b...
Definition: product_header_value.h:17
static bool TryParse(String input, System::SharedPtr< ProductHeaderValue > &parsedValue)
Tries to convert a passed string to an instance of the ProductHeaderValue class.
ProductHeaderValue(String name, String version)
Constructs a new instance.
String get_Name()
Returns the product token name.
String get_Version()
Returns the product token version.
String ToString() const override
Analog of C# Object.ToString() method. Enables converting custom objects to string.
static int32_t GetProductLength(String input, int32_t startIndex, System::SharedPtr< ProductHeaderValue > &parsedValue)
Converts a passed string from the specified index to an instance of the ProductHeaderValue class.
int32_t GetHashCode() const override
Analog of C# Object.GetHashCode() method. Enables hashing of custom objects.
static System::SharedPtr< ProductHeaderValue > Parse(String input)
Converts a passed string to an instance of the ProductHeaderValue class.
ProductHeaderValue(String name)
Constructs a new instance.
bool Equals(System::SharedPtr< Object > obj) override
Compares objects using C# Object.Equals semantics.
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