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 BUNDLE_INTERNAL_H_
18 #define BUNDLE_INTERNAL_H_
25 #include "include/bundle.h"
27 #include "key-info-internal.h"
29 namespace tizen_base {
32 static const char TAG_IMPORT_EXPORT_CHECK[] = "`zaybxcwdveuftgsh`";
37 Array = BUNDLE_TYPE_ARRAY,
38 Primitive = BUNDLE_TYPE_PRIMITIVE,
39 Measurable = BUNDLE_TYPE_MEASURABLE,
43 None = BUNDLE_TYPE_NONE,
44 Any = BUNDLE_TYPE_ANY,
45 String = BUNDLE_TYPE_STR,
46 StringArray = BUNDLE_TYPE_STR_ARRAY,
47 Byte = BUNDLE_TYPE_BYTE,
48 ByteArray = BUNDLE_TYPE_BYTE_ARRAY,
52 Bundle(unsigned char* raw, int size);
53 Bundle(int argc, char** argv);
56 Bundle(const Bundle& b);
57 Bundle& operator = (const Bundle& b);
58 Bundle(Bundle&& b) noexcept;
59 Bundle& operator = (Bundle&& b) noexcept;
61 bool operator == (const Bundle& b);
63 void Remove(const std::string& key);
64 void Add(std::shared_ptr<KeyInfo> key_info);
65 void Set(const std::string& key, int index, std::vector<unsigned char> value);
67 std::shared_ptr<KeyInfo>& Get(const std::string& key);
69 int GetType(const std::string& key);
71 unsigned char* Encode();
72 const std::map<std::string, std::shared_ptr<KeyInfo>>& GetMap();
73 std::vector<std::string> Export();
76 int Decode(unsigned char* raw, int size);
77 int Import(int argc, char** argv);
80 std::map<std::string, std::shared_ptr<KeyInfo>> map_;
83 } // namespace internal
84 } // namespace tizen_base
86 #endif // BUNDLE_INTERNAL_H_