• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef OHOS_DISTRIBUTED_DATA_RELATIONAL_STORE_INTERFACES_INNER_API_RDB_INCLUDE_BIG_INTEGER_H
17 #define OHOS_DISTRIBUTED_DATA_RELATIONAL_STORE_INTERFACES_INNER_API_RDB_INCLUDE_BIG_INTEGER_H
18 #include <unistd.h>
19 
20 #include <cinttypes>
21 #include <vector>
22 
23 #include "rdb_visibility.h"
24 namespace OHOS::NativeRdb {
25 class API_EXPORT BigInteger final {
26 public:
27     BigInteger() = default;
28     ~BigInteger() = default;
29 
30     BigInteger(int64_t value);
31     BigInteger(int32_t sign, std::vector<uint64_t> &&trueForm);
32     BigInteger(const BigInteger &other);
33     BigInteger(BigInteger &&other);
34     BigInteger &operator=(const BigInteger &other);
35     BigInteger &operator=(BigInteger &&other);
36     bool operator==(const BigInteger &other);
37     bool operator<(const BigInteger &rhs);
38 
39     int32_t Sign() const;
40     size_t Size() const;
41     const uint64_t *TrueForm() const;
42 
43     std::vector<uint64_t> Value() const;
44 
45 private:
46     int32_t sign_ = 0;
47     std::vector<uint64_t> value_;
48 };
49 } // namespace OHOS::NativeRdb
50 #endif // OHOS_DISTRIBUTED_DATA_RELATIONAL_STORE_INTERFACES_INNER_API_RDB_INCLUDE_BIG_INTEGER_H
51