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 <cinttypes> 19 #include <unistd.h> 20 #include <vector> 21 22 #include "rdb_visibility.h" 23 namespace OHOS::NativeRdb { 24 class API_EXPORT BigInteger final { 25 public: 26 BigInteger() = default; 27 ~BigInteger() = default; 28 29 BigInteger(int64_t value); 30 BigInteger(int32_t sign, std::vector<uint64_t> &&trueForm); 31 BigInteger(const BigInteger &other); 32 BigInteger(BigInteger &&other); 33 BigInteger &operator=(const BigInteger &other); 34 BigInteger &operator=(BigInteger &&other); 35 bool operator==(const BigInteger &other); 36 bool operator<(const BigInteger &rhs); 37 38 int32_t Sign() const; 39 size_t Size() const; 40 const uint64_t *TrueForm() const; 41 42 std::vector<uint64_t> Value() const; 43 private: 44 int32_t sign_ = 0; 45 std::vector<uint64_t> value_; 46 }; 47 } 48 #endif // OHOS_DISTRIBUTED_DATA_RELATIONAL_STORE_INTERFACES_INNER_API_RDB_INCLUDE_BIG_INTEGER_H 49