1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %% Purpose: wxLongLong documentation
4 %% Author: Vadim Zeitlin
8 %% Copyright: (c) Vadim Zeitlin
9 %% License: wxWindows license
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12 \section{\class{wxLongLong
}}\label{wxlonglong
}
14 This class represents a signed
64 bit long number. It is implemented using the
15 native
64 bit type where available (machines with
64 bit longs or compilers
16 which have (an analog of)
{\it long long
} type) and uses the emulation code in
17 the other cases which ensures that it is the most efficient solution for
18 working with
64 bit integers independently of the architecture.
20 wxLongLong defines all usual arithmetic operations such as addition,
21 substraction, bitwise shifts and logical operations as well as multiplication
22 and division (not yet for the machines without native
{\it long long
}). It
23 also has operators for implicit construction from and conversion to the native
24 {\it long long
} type if it exists and
{\it long
}.
26 You would usually use this type in exactly the same manner as any other
27 (built-in) arithmetic type. Note that wxLongLong is a signed type, if you
28 want unsigned values use wxULongLong.
30 If a native (i.e. supported directly by the compiler)
64 bit integer type was
31 found a typedef
{\it wxLongLong
\_t} will be defined to correspond it.
33 \wxheading{Derived from
}
37 \wxheading{Include files
}
41 \latexignore{\rtfignore{\wxheading{Members
}}}
43 \membersection{wxLongLong::wxLongLong
}\label{wxlonglongwxlonglongdef
}
45 \func{}{wxLongLong
}{\void}
47 Default constructor initializes the object to
0.
49 \membersection{wxLongLong::wxLongLong
}\label{wxlonglongwxlonglongll
}
51 \func{}{wxLongLong
}{\param{wxLongLong
\_t }{ll
}}
53 Constructor from native long long (only for compilers supporting it).
55 \membersection{wxLongLong::wxLongLong
}\label{wxlonglongwxlonglong
}
57 \func{}{wxLongLong
}{\param{long
}{hi
},
\param{unsigned long
}{lo
}}
59 Constructor from
2 longs: the high and low part are combined into one
62 \membersection{wxLongLong::operator=
}\label{wxlonglongoperatorassign
}
64 \func{wxLongLong\& operator
}{operator=
}{\param{wxLongLong
\_t }{ll
}}
66 Assignment operator from native long long (only for compilers supporting it).
68 \membersection{wxLongLong::Abs
}\label{wxlonglongabs
}
70 \constfunc{wxLongLong
}{Abs
}{\void}
72 \func{wxLongLong\&
}{Abs
}{\void}
74 Returns an absolute value of wxLongLong - either making a copy (const version)
75 or modifying it in place (the second one). Not in wxULongLong.
77 \membersection{wxLongLong::Assign
}\label{wxlonglongassign
}
79 \func{wxLongLong\&
}{Assign
}{\param{double
}{d
}}
81 This allows to convert a double value to wxLongLong type. Such conversion is
82 not always possible in which case the result will be silently truncated in a
83 platform-dependent way. Not in wxULongLong.
85 \membersection{wxLongLong::GetHi
}\label{wxlonglonggethi
}
87 \constfunc{long
}{GetHi
}{\void}
89 Returnes the high
32 bits of
64 bit integer.
91 \membersection{wxLongLong::GetLo
}\label{wxlonglonggetlo
}
93 \constfunc{unsigned long
}{GetLo
}{\void}
95 Returnes the low
32 bits of
64 bit integer.
97 \membersection{wxLongLong::GetValue
}\label{wxlonglonggetvalue
}
99 \constfunc{wxLongLong
\_t}{GetValue
}{\void}
101 Convert to native long long (only for compilers supporting it)
103 \membersection{wxLongLong::ToLong
}\label{wxlonglongtolong
}
105 \constfunc{long
}{ToLong
}{\void}
107 Truncate wxLongLong to long. If the conversion loses data (i.e. the wxLongLong
108 value is outside the range of built-in long type), an assert will be triggered
111 \membersection{wxLongLong::ToString
}\label{wxlonglongtostring
}
113 \constfunc{wxString
}{ToString
}{\void}
115 Returns the string representation of a wxLongLong.
117 \membersection{wxLongLong::operator$+$
}\label{wxlonglongoperatorplus
}
119 \constfunc{wxLongLong
}{operator$+$
}{\param{const wxLongLong\&
}{ll
}}
121 Adds
2 wxLongLongs together and returns the result.
123 \membersection{wxLongLong::operator$+=$
}\label{wxlonglongoperatorplusassign
}
125 \func{wxLongLong\&
}{operator+
}{\param{const wxLongLong\&
}{ll
}}
127 Add another wxLongLong to this one.
129 \membersection{wxLongLong::operator$++$
}\label{wxlonglongoperatorinc
}
131 \func{wxLongLong\&
}{operator$++$
}{\void}
133 \func{wxLongLong\&
}{operator$++$
}{\param{int
}{}}
135 Pre/post increment operator.
137 \membersection{wxLongLong::operator$-$
}\label{wxlonglongoperatorunaryminus
}
139 \constfunc{wxLongLong
}{operator$-$
}{\void}
141 Returns the value of this wxLongLong with opposite sign. Not in wxULongLong.
143 \membersection{wxLongLong::operator$-$
}\label{wxlonglongoperatorminus
}
145 \constfunc{wxLongLong
}{operator$-$
}{\param{const wxLongLong\&
}{ll
}}
147 Substracts
2 wxLongLongs and returns the result.
149 \membersection{wxLongLong::operator$-=$
}\label{wxlonglongoperatorminusassign
}
151 \func{wxLongLong\&
}{operator-
}{\param{const wxLongLong\&
}{ll
}}
153 Substracts another wxLongLong from this one.
155 \membersection{wxLongLong::operator$--$
}\label{wxlonglongoperatordec
}
157 \func{wxLongLong\&
}{operator$--$
}{\void}
159 \func{wxLongLong\&
}{operator$--$
}{\param{int
}{}}
161 Pre/post decrement operator.
163 % TODO document all other arithmetics operations: shifts, multiplication,
164 % division, bitwise, comparison