CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
content_range_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 ContentRangeHeaderValue : 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_Unit();
35 ASPOSECPP_SHARED_API void set_Unit(String value);
38 ASPOSECPP_SHARED_API Nullable<int64_t> get_From();
41 ASPOSECPP_SHARED_API Nullable<int64_t> get_To();
44 ASPOSECPP_SHARED_API Nullable<int64_t> get_Length();
47 ASPOSECPP_SHARED_API bool get_HasLength() const;
49 ASPOSECPP_SHARED_API bool get_HasRange() const;
50
55 ASPOSECPP_SHARED_API ContentRangeHeaderValue(int64_t from, int64_t to, int64_t length);
58 ASPOSECPP_SHARED_API ContentRangeHeaderValue(int64_t length);
62 ASPOSECPP_SHARED_API ContentRangeHeaderValue(int64_t from, int64_t to);
63
65 ASPOSECPP_SHARED_API bool Equals(System::SharedPtr<Object> obj) override;
67 ASPOSECPP_SHARED_API int32_t GetHashCode() const override;
69 ASPOSECPP_SHARED_API String ToString() const override;
73 ASPOSECPP_SHARED_API static System::SharedPtr<ContentRangeHeaderValue> Parse(String input);
78 ASPOSECPP_SHARED_API static bool TryParse(String input, System::SharedPtr<ContentRangeHeaderValue>& parsedValue);
84 ASPOSECPP_SHARED_API static int32_t GetContentRangeLength(String input, int32_t startIndex, System::SharedPtr<Object>& parsedValue);
85
86private:
88 String _unit;
94 Nullable<int64_t> _length;
95
98 MEMBER_FUNCTION_MAKE_OBJECT(ContentRangeHeaderValue, CODEPORTING_ARGS(), CODEPORTING_ARGS());
99
103 MEMBER_FUNCTION_MAKE_OBJECT(ContentRangeHeaderValue, CODEPORTING_ARGS(System::SharedPtr<ContentRangeHeaderValue> source), CODEPORTING_ARGS(source));
104
110 static bool TryGetLengthLength(String input, int32_t& current, int32_t& lengthLength);
118 static bool TryGetRangeLength(String input, int32_t& current, int32_t& fromLength, int32_t& toStartIndex,
119 int32_t& toLength);
131 static bool TryCreateContentRange(String input, String unit, int32_t fromStartIndex, int32_t fromLength,
132 int32_t toStartIndex, int32_t toLength, int32_t lengthStartIndex,
133 int32_t lengthLength, System::SharedPtr<Object>& parsedValue);
135 System::SharedPtr<Object> Clone() override;
136};
137
138}}}} // 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 'Content-Range' header. Objects of this class should only be allocated usin...
Definition: content_range_header_value.h:18
int32_t GetHashCode() const override
Analog of C# Object.GetHashCode() method. Enables hashing of custom objects.
bool get_HasLength() const
Gets a value that indicates if the length is specified for the current header.
bool get_HasRange() const
Gets a value that indicates if the range is specified for the current header.
ContentRangeHeaderValue(int64_t length)
Constructs a new instance.
String ToString() const override
Analog of C# Object.ToString() method. Enables converting custom objects to string.
static bool TryParse(String input, System::SharedPtr< ContentRangeHeaderValue > &parsedValue)
Tries to convert a passed string to an instance of the ContentRangeHeaderValue class.
Nullable< int64_t > get_To()
Gets a position at which data sending must stop.
static int32_t GetContentRangeLength(String input, int32_t startIndex, System::SharedPtr< Object > &parsedValue)
Converts a passed string from the specified position to an instance of the ContentRangeHeaderValue cl...
ContentRangeHeaderValue(int64_t from, int64_t to, int64_t length)
Constructs a new instance.
static System::SharedPtr< ContentRangeHeaderValue > Parse(String input)
Converts a passed string to an instance of the ContentRangeHeaderValue class.
String get_Unit()
Gets units used in the range.
bool Equals(System::SharedPtr< Object > obj) override
Compares objects using C# Object.Equals semantics.
ContentRangeHeaderValue(int64_t from, int64_t to)
Constructs a new instance.
Nullable< int64_t > get_From()
Gets a position at which data sending must start.
void set_Unit(String value)
Sets units used in the range.
Nullable< int64_t > get_Length()
Gets the length of an entity body.
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