as2js: /home/snapwebsites/snapcpp/contrib/as2js/include/as2js/int64.h Source File

int64.h
Go to the documentation of this file.
1 #ifndef AS2JS_INT64_H
2 #define AS2JS_INT64_H
3 /* include/as2js/int64.h
4 
5 Copyright (c) 2005-2019 Made to Order Software Corp. All Rights Reserved
6 
8 
9 Permission is hereby granted, free of charge, to any
10 person obtaining a copy of this software and
11 associated documentation files (the "Software"), to
12 deal in the Software without restriction, including
13 without limitation the rights to use, copy, modify,
14 merge, publish, distribute, sublicense, and/or sell
15 copies of the Software, and to permit persons to whom
16 the Software is furnished to do so, subject to the
17 following conditions:
18 
19 The above copyright notice and this permission notice
20 shall be included in all copies or substantial
21 portions of the Software.
22 
23 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
24 ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
25 LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
26 FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
27 EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
29 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
30 ARISING FROM, OUT OF OR IN CONNECTION WITH THE
31 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32 SOFTWARE.
33 
34 */
35 
36 #include "compare.h"
37 
38 #include <cstdint>
39 
40 
41 namespace as2js
42 {
43 
44 class Int64
45 {
46 public:
47  typedef int64_t int64_type;
48 
50  {
51  }
52 
53  Int64(int64_type const rhs)
54  {
55  f_int = rhs;
56  }
57 
58  Int64(Int64 const& rhs)
59  {
60  f_int = rhs.f_int;
61  }
62 
63  Int64& operator = (Int64 const& rhs)
64  {
65  f_int = rhs.f_int;
66  return *this;
67  }
68 
69  int64_type get() const
70  {
71  return f_int;
72  }
73 
74  void set(int64_type const new_int)
75  {
76  f_int = new_int;
77  }
78 
79  compare_t compare(Int64 const& rhs) const
80  {
81  return f_int == rhs.f_int ? compare_t::COMPARE_EQUAL
84  }
85 
86 private:
87  int64_type f_int = 0;
88 };
89 
90 
91 }
92 // namespace as2js
93 #endif
94 // #ifndef AS2JS_INT64_H
95 
96 // vim: ts=4 sw=4 et
Int64(Int64 const &rhs)
Definition: int64.h:58
Int64 & operator=(Int64 const &rhs)
Definition: int64.h:63
compare_t compare(Int64 const &rhs) const
Definition: int64.h:79
int64_type f_int
Definition: int64.h:87
Int64(int64_type const rhs)
Definition: int64.h:53
The AlexScript to JavaScript namespace.
Definition: compiler.cpp:37
compare_t
Definition: compare.h:41
int64_t int64_type
Definition: int64.h:47

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.

Syndicate content

Snap! Websites
An Open Source CMS System in C++

Contact Us Directly