CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
size.h
1
2#ifndef _aspose_system_drawing_size_h_
3#define _aspose_system_drawing_size_h_
4
5#include "fwd.h"
6#include <system/boxed_value.h>
7#include <system/string.h>
8
9namespace System { namespace Drawing {
13 class ASPOSECPP_SHARED_CLASS Size
14 {
15 RTTI_INFO_VALUE_TYPE(Size)
16 public:
18 ASPOSECPP_SHARED_API Size();
23 ASPOSECPP_SHARED_API Size(const Point& point);
27 ASPOSECPP_SHARED_API Size(int width, int height);
28
32 inline bool get_IsEmpty() const { return (m_width == 0 && m_height == 0); }
33
35 inline int get_Width() const { return m_width; }
37 inline int get_Height() const{ return m_height; }
38
41 inline void set_Width(int value) { m_width = value; }
44 inline void set_Height(int value) { m_height = value; }
45
50 ASPOSECPP_SHARED_API bool Equals(const Size& size) const;
53 ASPOSECPP_SHARED_API String ToString() const;
55 ASPOSECPP_SHARED_API int32_t GetHashCode() const;
56
62 static ASPOSECPP_SHARED_API Size Add(const Size& size1, const Size& size2);
68 static ASPOSECPP_SHARED_API Size Subtract(const Size& size1, const Size& size2);
69
74 static ASPOSECPP_SHARED_API Size Ceiling(const SizeF& size);
79 static ASPOSECPP_SHARED_API Size Truncate(const SizeF& size);
84 static ASPOSECPP_SHARED_API Size Round(const SizeF& size);
85
88 ASPOSECPP_SHARED_API operator SizeF() const;
91 ASPOSECPP_SHARED_API operator Point() const;
92
98 friend ASPOSECPP_SHARED_API Size operator+(const Size& size1, const Size& size2);
104 friend ASPOSECPP_SHARED_API Size operator-(const Size& size1, const Size& size2);
109 friend ASPOSECPP_SHARED_API bool operator==(const Size& size1, const Size& size2);
114 friend ASPOSECPP_SHARED_API bool operator!=(const Size& size1, const Size& size2);
115
117 ASPOSECPP_SHARED_API static const Size Empty;
118
119 private:
121 int m_width;
123 int m_height;
124
125 };
126
127}}
128
129namespace System
130{
132
134 template<> struct IsBoxable<Drawing::Size> : std::true_type {};
135
137 template <>
138 class BoxedValue<System::Drawing::Size> : public DefaultBoxedValue<System::Drawing::Size>
139 {
140 public:
144 : DefaultBoxedValue<System::Drawing::Size>(value)
145 {}
146 };
147
149}
150
151#endif // _aspose_system_drawing_size_h_
BoxedValue(const T &value)
Constructs an object that represents the specified value boxed.
Definition: boxed_value.h:192
Represents a pair of integer X and Y coordinates of a point on a 2-dimensional plane....
Definition: point.h:15
Represents a pair of single-precision floating point values that represent width and height of an ima...
Definition: size_f.h:14
Represents a pair of integer values that represent width and height of an image. This type should be ...
Definition: size.h:14
Size()
Constructs a new Size object and initializes its width and height values with 0.
String ToString() const
Returns the string representation of the pair of width and hegiht values represented by the current o...
friend Size operator+(const Size &size1, const Size &size2)
Returns a new Size object that is a sum of the specified Size object, i.e. whose width value is equal...
friend Size operator-(const Size &size1, const Size &size2)
Returns a new Size object that is the results of subctraction of size2 from size1,...
static Size Round(const SizeF &size)
Constructs a Size object from the specified SizeF object by rounding the SizeF object's width and hei...
void set_Width(int value)
Sets the value of width represented by the current object.
Definition: size.h:41
static Size Ceiling(const SizeF &size)
Constructs a Size object from the specified SizeF object by rounding the SizeF object's width and hei...
static Size Add(const Size &size1, const Size &size2)
Returns a new Size object that is a sum of the specified Size object, i.e. whose width value is equal...
bool get_IsEmpty() const
Determines if both width and hegiht values are equal to 0.
Definition: size.h:32
static const Size Empty
An empty instance of Size class whose width and height values are 0.
Definition: size.h:117
int get_Height() const
Returns the value of heght represented by the current object.
Definition: size.h:37
int get_Width() const
Returns the value of width represented by the current object.
Definition: size.h:35
Size(const Point &point)
Constructs a new Size object and initializes its width and height values with the values of X and Y c...
friend bool operator==(const Size &size1, const Size &size2)
Determines the equality of two Size objects by comparing their corresponding width and height values.
int32_t GetHashCode() const
Returns a hash code for the current object.
friend bool operator!=(const Size &size1, const Size &size2)
Determines the inequality of two Size objects by comparing their corresponding width and height value...
Size(int width, int height)
Constructs a new Size object and initializes it with the specified value.
static Size Truncate(const SizeF &size)
Constructs a Size object from the specified SizeF object by truncating the SizeF object's width and h...
static Size Subtract(const Size &size1, const Size &size2)
Returns a new Size object that is the results of subctraction of size2 from size1,...
bool Equals(const Size &size) const
Determines if the current object and the specified object are equal, i.e. represent the same pair of ...
void set_Height(int value)
Sets the value of height represented by the current object.
Definition: size.h:44
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