CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
version.h
1
3#ifndef _version_h_
4#define _version_h_
5
6#include "system/string.h"
7
8namespace System
9{
10
14class ASPOSECPP_SHARED_CLASS Version
15{
16public:
22 ASPOSECPP_SHARED_API Version(int major, int minor, int build, int revision);
27 ASPOSECPP_SHARED_API Version(int major, int minor, int build);
31 ASPOSECPP_SHARED_API Version(int major, int minor);
34 ASPOSECPP_SHARED_API Version(const String& version);
36 ASPOSECPP_SHARED_API Version();
37
39 ASPOSECPP_SHARED_API int get_Major() const;
41 ASPOSECPP_SHARED_API int get_Minor() const;
43 ASPOSECPP_SHARED_API int get_Build() const;
45 ASPOSECPP_SHARED_API int get_Revision() const;
47 ASPOSECPP_SHARED_API int16_t get_MajorRevision() const;
49 ASPOSECPP_SHARED_API int16_t get_MinorRevision() const;
53 ASPOSECPP_SHARED_API int CompareTo(const Version& ver) const;
55 ASPOSECPP_SHARED_API int GetHashCode() const;
59 ASPOSECPP_SHARED_API bool Equals(const Version& ver) const;
60
62 ASPOSECPP_SHARED_API String ToString() const;
66 ASPOSECPP_SHARED_API String ToString(int fieldCount) const;
67
68 // .NET 2.0 does not have this method
72 static ASPOSECPP_SHARED_API Version Parse(const String& input);
73
78 friend ASPOSECPP_SHARED_API bool operator==(const Version& lhs, const Version& rhs);
83 friend ASPOSECPP_SHARED_API bool operator!=(const Version& lhs, const Version& rhs);
88 friend ASPOSECPP_SHARED_API bool operator<(const Version& lhs, const Version& rhs);
93 friend ASPOSECPP_SHARED_API bool operator<=(const Version& lhs, const Version& rhs);
98 friend ASPOSECPP_SHARED_API bool operator>(const Version& lhs, const Version& rhs);
103 friend ASPOSECPP_SHARED_API bool operator>=(const Version& lhs, const Version& rhs);
104
105private:
107 int m_major;
109 int m_minor;
111 int m_build;
113 int m_revision;
114};
115
120inline std::ostream& operator<<(std::ostream& stream, const Version& version)
121{
122 stream << version.ToString();
123 return stream;
124}
125
130inline std::wostream& operator<<(std::wostream& stream, const Version& version)
131{
132 stream << version.ToString();
133 return stream;
134}
135
136} // namespace System
137
138#endif // _version_h_
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
Represents a version number. This type should be allocated on stack and passed to functions by value ...
Definition: version.h:15
String ToString() const
Returns the string representation of the version number represented by the current object.
int get_Minor() const
Returns the minor version.
friend bool operator!=(const Version &lhs, const Version &rhs)
Determines if the version numbers represented by the specified Version objects are not equal.
int16_t get_MinorRevision() const
Returns the low 16-bit value of the revision number.
int CompareTo(const Version &ver) const
Compares the versions represented by the current object and the specified object.
Version(int major, int minor, int build)
Constructs an instance that represent the specified major, minor and build values.
Version(int major, int minor, int build, int revision)
Constructs an instance that represent the specified major, minor, build and revsion values.
String ToString(int fieldCount) const
Returns the string representation of the specified number of sections of version number represented b...
bool Equals(const Version &ver) const
Determines if the version numbers represented by the current and the specified objects are equal.
friend bool operator>(const Version &lhs, const Version &rhs)
Determines the relation between the version numbers represented by the specified Version objects.
friend bool operator>=(const Version &lhs, const Version &rhs)
Determines the relation between the version numbers represented by the specified Version objects.
int GetHashCode() const
Returns a hash code for the current object.
static Version Parse(const String &input)
Converts the string representation of a version number into equivalent instance of Version class.
Version()
Constructs an instance that represents version number 0.0.-1.-1.
friend bool operator==(const Version &lhs, const Version &rhs)
Determines if the version numbers represented by the specified Version objects are equal.
friend bool operator<=(const Version &lhs, const Version &rhs)
Determines the relation between the version numbers represented by the specified Version objects.
Version(int major, int minor)
Constructs an instance that represent the specified major and values.
Version(const String &version)
Constructs an instance that represent the version number represented as a string.
int get_Build() const
Returns the build number.
int get_Major() const
Returns the major version.
int get_Revision() const
Returns the revision number.
friend bool operator<(const Version &lhs, const Version &rhs)
Determines the relation between the version numbers represented by the specified Version objects.
int16_t get_MajorRevision() const
Returns the high 16-bit value of the revision number.
Definition: db_command.h:9
std::ostream & operator<<(std::ostream &stream, DateTime date_time)
Insert data into the stream using UTF-8 encoding.
Definition: date_time.h:729