CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
warning_header_value.h
1
2#pragma once
3
4#include "system/date_time_offset.h"
5#include <cstdint>
6#include <system/icloneable.h>
7#include <system/nullable.h>
8#include <system/object.h>
9#include <system/shared_ptr.h>
10#include <system/string.h>
11
12namespace System { namespace Net { namespace Http { namespace Headers {
13
18class ASPOSECPP_SHARED_CLASS WarningHeaderValue : public System::ICloneable
19{
24
26 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
28 ASPOSECPP_SHARED_RTTI_INFO_DECL();
29
30public:
33 ASPOSECPP_SHARED_API int32_t get_Code();
36 ASPOSECPP_SHARED_API String get_Agent();
39 ASPOSECPP_SHARED_API String get_Text();
42 ASPOSECPP_SHARED_API Nullable<DateTimeOffset> get_Date();
43
48 ASPOSECPP_SHARED_API WarningHeaderValue(int32_t code, String agent, String text);
54 ASPOSECPP_SHARED_API WarningHeaderValue(int32_t code, String agent, String text, DateTimeOffset date);
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<WarningHeaderValue> Parse(String input);
70 ASPOSECPP_SHARED_API static bool TryParse(String input, System::SharedPtr<WarningHeaderValue>& parsedValue);
76 ASPOSECPP_SHARED_API static int32_t GetWarningLength(String input, int32_t startIndex, System::SharedPtr<Object>& parsedValue);
77
78private:
80 int32_t _code;
82 String _agent;
84 String _text;
87
90 MEMBER_FUNCTION_MAKE_OBJECT(WarningHeaderValue, CODEPORTING_ARGS(), CODEPORTING_ARGS());
94 MEMBER_FUNCTION_MAKE_OBJECT(WarningHeaderValue, CODEPORTING_ARGS(System::SharedPtr<WarningHeaderValue> source), CODEPORTING_ARGS(source));
95
102 static bool TryReadAgent(String input, int32_t startIndex, int32_t& current, String& agent);
108 static bool TryReadCode(String input, int32_t& current, int32_t& code);
114 static bool TryReadDate(String input, int32_t& current, Nullable<DateTimeOffset>& date);
116 System::SharedPtr<Object> Clone() override;
118 static void CheckCode(int32_t code);
120 static void CheckAgent(String agent);
121};
122
123}}}} // namespace System::Net::Http::Headers
Contains the date and time of day relative to Coordinated Universal Time. Objects of this class shoul...
Definition: date_time_offset.h:16
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 'Warning' header. Objects of this class should only be allocated using Syst...
Definition: warning_header_value.h:19
String get_Text()
Returns the warning text.
bool Equals(System::SharedPtr< Object > obj) override
Compares objects using C# Object.Equals semantics.
static System::SharedPtr< WarningHeaderValue > Parse(String input)
Converts a passed string to an instance of the WarningHeaderValue class.
WarningHeaderValue(int32_t code, String agent, String text, DateTimeOffset date)
Constructs a new instance.
int32_t get_Code()
Returns a warning code.
Nullable< DateTimeOffset > get_Date()
Returns the datetime of the warning.
String ToString() const override
Analog of C# Object.ToString() method. Enables converting custom objects to string.
static bool TryParse(String input, System::SharedPtr< WarningHeaderValue > &parsedValue)
Tries to convert a passed string to an instance of the WarningHeaderValue class.
static int32_t GetWarningLength(String input, int32_t startIndex, System::SharedPtr< Object > &parsedValue)
Converts a passed string from the specified index to an instance of the WarningHeaderValue class.
WarningHeaderValue(int32_t code, String agent, String text)
Constructs a new instance.
int32_t GetHashCode() const override
Analog of C# Object.GetHashCode() method. Enables hashing of custom objects.
String get_Agent()
Returns the host attached to the warning.
Forward declaration.
Definition: nullable.h:74
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