2 * Copyright (c) 2020 Samsung Electronics Co., Ltd. All rights reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef KEY_INFO_INTERNAL_H_
18 #define KEY_INFO_INTERNAL_H_
24 namespace tizen_base {
29 KeyInfo(int type, std::string key,
30 std::vector<unsigned char> value);
31 KeyInfo(int type, std::string key,
32 std::vector<std::vector<unsigned char>> values);
33 explicit KeyInfo(std::vector<unsigned char> encoded_bytes);
34 virtual ~KeyInfo() = default;
36 KeyInfo(const KeyInfo& key_info);
37 KeyInfo& operator = (const KeyInfo& key_info);
38 KeyInfo(KeyInfo&& key_info) noexcept;
39 KeyInfo& operator = (KeyInfo&& key_info) noexcept;
41 bool operator == (const KeyInfo& key_info);
45 const std::string& GetKey();
46 const std::vector<std::unique_ptr<unsigned char[]>>& GetValues();
47 const std::vector<std::size_t>& GetValuesSize();
48 const std::vector<unsigned int>& GetUValuesSize();
49 std::vector<unsigned char> Encode();
51 int SetValue(int index, const std::vector<unsigned char>& value);
55 std::size_t GetEncodedSize();
57 int SetValue(const std::vector<unsigned char>& value);
58 int SetValues(const std::vector<std::vector<unsigned char>>& values);
59 int Decode(const std::vector<unsigned char>& bytes);
64 std::vector<std::unique_ptr<unsigned char[]>> values_;
65 std::vector<std::size_t> values_size_;
66 std::vector<unsigned int> uvalues_size_;
69 } // namespace internal
70 } // namespace tizen_base
72 #endif // KEY_INFO_INTERNAL_H_