CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
string_with_quality_header_value.h
1
2#pragma once
3
4#include <cstdint>
5#include <system/icloneable.h>
6#include <system/nullable.h>
7#include <system/object.h>
8#include <system/shared_ptr.h>
9#include <system/string.h>
10
11namespace System { namespace Net { namespace Http { namespace Headers {
12
17class ASPOSECPP_SHARED_CLASS StringWithQualityHeaderValue : public System::ICloneable
18{
23
25 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
27 ASPOSECPP_SHARED_RTTI_INFO_DECL();
28
29public:
32 ASPOSECPP_SHARED_API String get_Value();
35 ASPOSECPP_SHARED_API Nullable<double> get_Quality();
36
39 ASPOSECPP_SHARED_API StringWithQualityHeaderValue(String value);
43 ASPOSECPP_SHARED_API StringWithQualityHeaderValue(String value, double quality);
44
46 ASPOSECPP_SHARED_API String ToString() const override;
48 ASPOSECPP_SHARED_API bool Equals(System::SharedPtr<Object> obj) override;
50 ASPOSECPP_SHARED_API int32_t GetHashCode() const override;
59 ASPOSECPP_SHARED_API static bool TryParse(String input, System::SharedPtr<StringWithQualityHeaderValue>& parsedValue);
65 ASPOSECPP_SHARED_API static int32_t GetStringWithQualityLength(String input, int32_t startIndex, System::SharedPtr<Object>& parsedValue);
66
67private:
69 String _value;
71 Nullable<double> _quality;
72
76 MEMBER_FUNCTION_MAKE_OBJECT(StringWithQualityHeaderValue, CODEPORTING_ARGS(System::SharedPtr<StringWithQualityHeaderValue> source), CODEPORTING_ARGS(source));
79 MEMBER_FUNCTION_MAKE_OBJECT(StringWithQualityHeaderValue, CODEPORTING_ARGS(), CODEPORTING_ARGS());
80
86 static bool TryReadQuality(String input, System::SharedPtr<StringWithQualityHeaderValue> result, int32_t& index);
87
89 System::SharedPtr<Object> Clone() override;
90};
91
92}}}} // 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 with an additional quality of a string header. Objects of this class should only b...
Definition: string_with_quality_header_value.h:18
Nullable< double > get_Quality()
Returns a quality.
static int32_t GetStringWithQualityLength(String input, int32_t startIndex, System::SharedPtr< Object > &parsedValue)
Converts a passed string from the specified index to an instance of the StringWithQualityHeaderValue ...
StringWithQualityHeaderValue(String value)
Constructs a new instance.
static System::SharedPtr< StringWithQualityHeaderValue > Parse(String input)
Converts a passed string to an instance of the StringWithQualityHeaderValue class.
bool Equals(System::SharedPtr< Object > obj) override
Compares objects using C# Object.Equals semantics.
static bool TryParse(String input, System::SharedPtr< StringWithQualityHeaderValue > &parsedValue)
Tries to convert a passed string to an instance of the StringWithQualityHeaderValue class.
int32_t GetHashCode() const override
Analog of C# Object.GetHashCode() method. Enables hashing of custom objects.
StringWithQualityHeaderValue(String value, double quality)
Constructs a new instance.
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
Definition: db_command.h:9