/base/security/access_token/interfaces/innerkits/nativetoken/test/mock/include/ |
H A D | cJSON.h | 25 /* The cJSON structure: */ 27 typedef struct cJSON { struct 28 struct cJSON* next; 29 struct cJSON* prev; 30 struct cJSON* child; 36 } cJSON; typedef 52 cJSON* cJSON_GetObjectItem(const cJSON* const object, const char* const string); 53 cJSON_bool cJSON_IsNumber(const cJSON* const item); 54 cJSON_bool cJSON_IsString(const cJSON* cons [all...] |
/base/security/access_token/interfaces/innerkits/nativetoken/test/mock/src/ |
H A D | cJSON.c | 16 #include "cJSON.h" 58 cJSON* cJSON_GetObjectItem(const cJSON* const object, const char* const string) in cJSON_GetObjectItem() 68 cJSON* (*func)(const cJSON* const object, const char* const string); in cJSON_GetObjectItem() 69 func = (cJSON* (*)(const cJSON* const object, const char* const string))dlsym(g_handle, "cJSON_GetObjectItem"); in cJSON_GetObjectItem() 73 cJSON* res = func(object, string); in cJSON_GetObjectItem() 78 cJSON_bool cJSON_IsNumber(const cJSON* const item) in cJSON_IsNumber() 83 cJSON_bool (*func)(const cJSON* cons in cJSON_IsNumber() [all...] |
/base/sensors/miscdevice/utils/common/include/ |
H A D | json_parser.h | 23 #include "cJSON.h"
34 int32_t ParseJsonArray(cJSON *json, const std::string &key, std::vector<std::string> &vals) const;
36 bool HasObjectItem(cJSON *json, const std::string &key) const;
38 cJSON *GetObjectItem(cJSON *json, const std::string &key) const;
39 cJSON *GetObjectItem(const std::string &key) const;
40 bool IsArray(cJSON *json) const;
41 int32_t GetArraySize(cJSON *json) const;
42 cJSON *GetArrayItem(cJSON *jso [all...] |
/base/hiviewdfx/hiview/base/utility/include/ |
H A D | cjson_util.h | 22 #include "cJSON.h" 32 cJSON* ParseJsonRoot(const std::string& configFile); 41 int64_t GetIntValue(const cJSON* json, const std::string& key, int64_t defaultValue = 0); 50 double GetDoubleValue(cJSON* json, const std::string& key, double defaultValue = 0.0); 58 std::string GetStringValue(cJSON* json, const std::string& key); 66 void GetStringArray(cJSON* json, const std::string& key, std::vector<std::string>& dest); 74 cJSON* GetObjectValue(const cJSON* json, const std::string& key); 82 cJSON* GetArrayValue(const cJSON* jso [all...] |
/base/hiviewdfx/hiview/base/utility/ |
H A D | cjson_util.cpp | 24 cJSON* ParseJsonRoot(const std::string& configFile) in ParseJsonRoot() 31 cJSON* root = cJSON_Parse(content.c_str()); in ParseJsonRoot() 36 int64_t GetIntValue(const cJSON* json, const std::string& key, int64_t defaultValue) in GetIntValue() 41 cJSON* intJson = cJSON_GetObjectItem(json, key.c_str()); in GetIntValue() 48 double GetDoubleValue(cJSON* json, const std::string& key, double defaultValue) in GetDoubleValue() 53 cJSON* doubleJson = cJSON_GetObjectItem(json, key.c_str()); in GetDoubleValue() 60 std::string GetStringValue(cJSON* json, const std::string& key) in GetStringValue() 65 cJSON* str = cJSON_GetObjectItem(json, key.c_str()); in GetStringValue() 72 void GetStringArray(cJSON* json, const std::string& key, std::vector<std::string>& dest) in GetStringArray() 77 cJSON* strArra in GetStringArray() [all...] |
/base/startup/appspawn/service/hnp/base/ |
H A D | hnp_json.c | 19 #include "cJSON.h" 28 static int ParseLinksJsonToCfgInfo(cJSON *linksItem, HnpCfgInfo *hnpCfg) in ParseLinksJsonToCfgInfo() 41 cJSON *link = cJSON_GetArrayItem(linksItem, i); in ParseLinksJsonToCfgInfo() 46 cJSON *sourceItem = cJSON_GetObjectItem(link, "source"); in ParseLinksJsonToCfgInfo() 58 cJSON *targetItem = cJSON_GetObjectItem(link, "target"); in ParseLinksJsonToCfgInfo() 73 static int ParseJsonStreamToHnpCfgInfo(cJSON *json, HnpCfgInfo *hnpCfg) in ParseJsonStreamToHnpCfgInfo() 77 cJSON *typeItem = cJSON_GetObjectItem(json, "type"); in ParseJsonStreamToHnpCfgInfo() 86 cJSON *nameItem = cJSON_GetObjectItem(json, "name"); in ParseJsonStreamToHnpCfgInfo() 96 cJSON *versionItem = cJSON_GetObjectItem(json, "version"); in ParseJsonStreamToHnpCfgInfo() 106 cJSON *installIte in ParseJsonStreamToHnpCfgInfo() [all...] |
/base/security/device_security_level/baselib/utils/src/ |
H A D | utils_json.c | 20 #include "cJSON.h" 28 cJSON *root = NULL; in DslmCreateJson() 41 cJSON_Delete((cJSON *)handle); in DslmDestroyJson() 54 return ((cJSON *)handle)->valueint; in DslmGetJsonFieldInt() 57 cJSON *objValue = NULL; in DslmGetJsonFieldInt() 60 objValue = (cJSON *)DslmGetJsonFieldJson(handle, field); in DslmGetJsonFieldInt() 79 cJSON *objValue = cJSON_GetObjectItem(handle, field); in DslmGetJsonFieldIntArray() 93 cJSON *item = cJSON_GetArrayItem(objValue, i); in DslmGetJsonFieldIntArray() 108 (void)cJSON_AddBoolToObject((cJSON *)handle, field, value); in DslmAddFieldBoolToJson() 117 return ((cJSON *)handl in DslmGetJsonFieldString() [all...] |
/base/security/device_auth/frameworks/deviceauth_lite/source/json/ |
H A D | jsonutil.c | 18 #include "cJSON.h" 22 cJSON *root = NULL; in parse_json() 33 cJSON_Delete((cJSON *)handle); in free_json() 39 return cJSON_GetObjectItem((cJSON *)parent, field); in get_json_obj() 50 return ((cJSON *)obj)->valueint; in get_json_int() 53 cJSON *obj_value = NULL; in get_json_int() 56 obj_value = (cJSON *)get_json_obj(obj, field); in get_json_int() 75 return ((cJSON *)obj)->valuestring; in get_json_string() 77 cJSON *obj_value = NULL; in get_json_string() 81 obj_value = (cJSON *)get_json_ob in get_json_string() [all...] |
/base/customization/enterprise_device_management/interfaces/inner_api/plugin_kits/include/utils/ |
H A D | cjson_serializer.h | 21 #include "cJSON.h" 26 * Policy data serializer of type cJSON. 28 class CjsonSerializer : public IPolicySerializer<cJSON*>, public DelayedSingleton<CjsonSerializer> { 30 bool Deserialize(const std::string &jsonString, cJSON* &dataObj) override; 32 bool Serialize(cJSON *const &dataObj, std::string &jsonString) override; 34 bool GetPolicy(MessageParcel &data, cJSON* &result) override; 36 bool WritePolicy(MessageParcel &reply, cJSON* &result) override; 38 bool MergePolicy(std::vector<cJSON*> &data, cJSON* &result) override;
|
/base/sensors/miscdevice/utils/common/src/ |
H A D | json_parser.cpp | 57 bool JsonParser::HasObjectItem(cJSON *json, const std::string &key) const
in HasObjectItem() 67 cJSON *JsonParser::GetObjectItem(cJSON *json, const std::string &key) const
in GetObjectItem() 80 cJSON *JsonParser::GetObjectItem(const std::string &key) const
in GetObjectItem() 85 int32_t JsonParser::ParseJsonArray(cJSON *json, const std::string &key,
in ParseJsonArray() 88 cJSON *jsonArray = GetObjectItem(json, key);
in ParseJsonArray() 95 cJSON *val = cJSON_GetArrayItem(jsonArray, i);
in ParseJsonArray() 110 bool JsonParser::IsArray(cJSON *json) const
in IsArray() 115 int32_t JsonParser::GetArraySize(cJSON *json) const
in GetArraySize() 120 cJSON *JsonParse [all...] |
/base/security/appverify/interfaces/innerkits/appverify/include/init/ |
H A D | json_parser_utils.h | 22 #include "cJSON.h"
28 using JsonObjVec = std::vector<cJSON*>;
33 static bool ReadTrustedRootCAFromJson(cJSON** jsonObj, const std::string& jsonPath, std::string& error);
34 static bool GetJsonString(const cJSON* json, const std::string& key, std::string& value);
35 static bool ParseJsonToObjVec(const cJSON* json, const std::string& key, JsonObjVec& jsonObjVec);
36 static bool GetJsonInt(const cJSON* json, const std::string& key, int& value);
37 static bool GetJsonStringVec(const cJSON* json, const std::string& key, StringVec& value);
38 static void ParseJsonToMap(const cJSON* json, JsonMap& JsonMap);
|
/base/security/access_token/interfaces/innerkits/nativetoken/include/ |
H A D | nativetoken_json_oper.h | 17 #include "cJSON.h"
28 extern uint32_t GetProcessNameFromJson(cJSON *cjsonItem, NativeTokenList *tokenNode);
29 extern uint32_t GetTokenIdFromJson(cJSON *cjsonItem, NativeTokenList *tokenNode);
30 extern uint32_t GetAplFromJson(cJSON *cjsonItem, NativeTokenList *tokenNode);
31 extern uint32_t GetInfoArrFromJson(cJSON *cjsonItem, char *strArr[], int32_t *strNum, StrArrayAttr *attr);
32 extern cJSON *CreateNativeTokenJsonObject(const NativeTokenList *curr);
33 extern uint32_t UpdateGoalItemFromRecord(const NativeTokenList *tokenNode, cJSON *record);
|
/base/inputmethod/imf/services/json/include/ |
H A D | serializable.h | 21 #include "cJSON.h" 33 virtual bool Unmarshal(cJSON *node) = 0; 34 virtual bool Marshal(cJSON *node) const in Marshal() 38 static bool GetValue(cJSON *node, const std::string &name, std::string &value); 39 static bool GetValue(cJSON *node, const std::string &name, int32_t &value); 40 static bool GetValue(cJSON *node, const std::string &name, uint32_t &value); 41 static bool GetValue(cJSON *node, const std::string &name, bool &value); 42 static bool GetValue(cJSON *node, const std::string &name, Serializable &value); 44 static bool GetValue(cJSON *node, const std::string &name, std::vector<T> &values, int32_t maxNum = 0) in GetValue() 67 static bool SetValue(cJSON *nod in GetValue() [all...] |
/base/security/appverify/interfaces/innerkits/appverify/src/init/ |
H A D | json_parser_utils.cpp | 26 bool JsonParserUtils::ReadTrustedRootCAFromJson(cJSON** jsonObj,
in ReadTrustedRootCAFromJson() 55 bool JsonParserUtils::GetJsonString(const cJSON* json, const std::string& key, std::string& value)
in GetJsonString() 60 cJSON* jsonValue = cJSON_GetObjectItemCaseSensitive(json, key.c_str());
in GetJsonString() 67 bool JsonParserUtils::GetJsonInt(const cJSON* json, const std::string& key, int& value)
in GetJsonInt() 72 cJSON* jsonValue = cJSON_GetObjectItemCaseSensitive(json, key.c_str());
in GetJsonInt() 79 bool JsonParserUtils::GetJsonStringVec(const cJSON* json, const std::string& key, StringVec& value)
in GetJsonStringVec() 84 cJSON* jsonArray = cJSON_GetObjectItemCaseSensitive(json, key.c_str());
in GetJsonStringVec() 88 cJSON* item = NULL;
in GetJsonStringVec() 97 bool JsonParserUtils::ParseJsonToObjVec(const cJSON* json, const std::string& key, JsonObjVec& jsonObjVec)
in ParseJsonToObjVec() 102 cJSON* jsonArra in ParseJsonToObjVec() [all...] |
/base/customization/enterprise_device_management/interfaces/inner_api/plugin_kits/src/utils/ |
H A D | cjson_serializer.cpp | 20 bool CjsonSerializer::Deserialize(const std::string &jsonString, cJSON* &dataObj) in Deserialize() 26 bool CjsonSerializer::Serialize(cJSON *const &dataObj, std::string &jsonString) in Serialize() 39 bool CjsonSerializer::GetPolicy(MessageParcel &data, cJSON* &result) in GetPolicy() 45 bool CjsonSerializer::WritePolicy(MessageParcel &reply, cJSON* &result) in WritePolicy() 54 bool CjsonSerializer::MergePolicy(std::vector<cJSON*> &data, cJSON* &result) in MergePolicy()
|
/base/security/access_token/interfaces/innerkits/nativetoken/src/ |
H A D | nativetoken_json_oper.c | 32 uint32_t GetProcessNameFromJson(cJSON *cjsonItem, NativeTokenList *tokenNode) in GetProcessNameFromJson() 34 cJSON *processNameJson = cJSON_GetObjectItem(cjsonItem, PROCESS_KEY_NAME); in GetProcessNameFromJson() 48 uint32_t GetTokenIdFromJson(cJSON *cjsonItem, NativeTokenList *tokenNode) in GetTokenIdFromJson() 50 cJSON *tokenIdJson = cJSON_GetObjectItem(cjsonItem, TOKENID_KEY_NAME); in GetTokenIdFromJson() 66 uint32_t GetAplFromJson(cJSON *cjsonItem, NativeTokenList *tokenNode) in GetAplFromJson() 68 cJSON *aplJson = cJSON_GetObjectItem(cjsonItem, APL_KEY_NAME); in GetAplFromJson() 82 uint32_t GetInfoArrFromJson(cJSON *cjsonItem, char *strArr[], int32_t *strNum, StrArrayAttr *attr) in GetInfoArrFromJson() 84 cJSON *strArrJson = cJSON_GetObjectItem(cjsonItem, attr->strKey); in GetInfoArrFromJson() 93 cJSON *item = cJSON_GetArrayItem(strArrJson, i); in GetInfoArrFromJson() 118 static int32_t AddStrArrayInfo(cJSON *objec [all...] |
/base/security/device_auth/interfaces/inner_api/ |
H A D | device_auth_ext.h | 20 #include "cJSON.h" 42 int32_t (*init)(struct ExtPlugin *extPlugin, const cJSON *params, const struct ExtPluginCtx *context); 83 int32_t (*excuteCredMgrCmd)(int32_t osAccount, int32_t cmdId, const cJSON *in, cJSON *out); 85 int32_t (*createSession)(int32_t *sessionId, const cJSON *in, cJSON *out); 87 int32_t (*processSession)(int32_t *sessionId, const cJSON *in, cJSON *out, int32_t *status); 147 int32_t InitExtPart(const cJSON *params, ExtPart *extPart);
|
/base/startup/appspawn/util/include/ |
H A D | json_utils.h | 22 #include "cJSON.h" 30 typedef int (*ParseConfig)(const cJSON *root, ParseJsonContext *context); 32 cJSON *GetJsonObjFromFile(const char *jsonPath); 34 __attribute__((always_inline)) inline char *GetStringFromJsonObj(const cJSON *json, const char *key) in GetStringFromJsonObj() 38 cJSON *obj = cJSON_GetObjectItemCaseSensitive(json, key); in GetStringFromJsonObj() 44 __attribute__((always_inline)) inline bool GetBoolValueFromJsonObj(const cJSON *json, const char *key, bool def) in GetBoolValueFromJsonObj() 55 __attribute__((always_inline)) inline uint32_t GetIntValueFromJsonObj(const cJSON *json, const char *key, uint32_t def) in GetIntValueFromJsonObj()
|
/base/telephony/core_service/services/sim/include/ |
H A D | operator_file_parser.h | 20 #include "cJSON.h" 30 bool ParseFromCustomSystem(int32_t slotId, OperatorConfig &opc, cJSON *root); 32 OperatorConfig &poc, const std::string &path, cJSON *root, bool needSaveTempOpc = false); 33 bool WriteOperatorConfigJson(std::string filename, const cJSON *root); 40 void ParseOperatorConfigFromJson(const cJSON *root, OperatorConfig &poc, bool needSaveTempOpc); 42 void CreateJsonFromOperatorConfig(cJSON *root); 43 void ParseArray(const std::string key, const cJSON *value, OperatorConfig &poc);
|
/base/inputmethod/imf/services/json/src/ |
H A D | serializable.cpp | 34 cJSON *root = cJSON_CreateObject(); in Marshall() 54 bool Serializable::GetValue(cJSON *node, const std::string &name, std::string &value) in GetValue() 65 bool Serializable::GetValue(cJSON *node, const std::string &name, int32_t &value) in GetValue() 76 bool Serializable::GetValue(cJSON *node, const std::string &name, uint32_t &value) in GetValue() 92 bool Serializable::GetValue(cJSON *node, const std::string &name, bool &value) in GetValue() 103 bool Serializable::GetValue(cJSON *node, const std::string &name, Serializable &value) in GetValue() 113 bool Serializable::SetValue(cJSON *node, const std::string &name, const std::string &value) in SetValue() 119 bool Serializable::SetValue(cJSON *node, const std::string &name, const int32_t &value) in SetValue() 125 cJSON *Serializable::GetSubNode(cJSON *nod [all...] |
/base/security/appverify/interfaces/innerkits/appverify/src/provision/ |
H A D | provision_verify.cpp | 21 #include "cJSON.h"
82 void GetStringIfExist(const cJSON* obj, const std::string& key, std::string& out)
in GetStringIfExist() 87 cJSON* jsonValue = cJSON_GetObjectItemCaseSensitive(obj, key.c_str());
in GetStringIfExist() 93 void GetInt32IfExist(const cJSON* obj, const std::string& key, int32_t& out)
in GetInt32IfExist() 98 cJSON* jsonValue = cJSON_GetObjectItemCaseSensitive(obj, key.c_str());
in GetInt32IfExist() 104 void GetInt64IfExist(const cJSON* obj, const std::string& key, int64_t& out)
in GetInt64IfExist() 109 cJSON* jsonValue = cJSON_GetObjectItemCaseSensitive(obj, key.c_str());
in GetInt64IfExist() 115 void GetStringArrayIfExist(const cJSON* obj, const std::string& key, std::vector<std::string>& out)
in GetStringArrayIfExist() 120 cJSON* jsonArray = cJSON_GetObjectItemCaseSensitive(obj, key.c_str());
in GetStringArrayIfExist() 124 cJSON* ite in GetStringArrayIfExist() [all...] |
/base/customization/enterprise_device_management/services/edm_plugin/src/utils/ |
H A D | watermark_image_serializer.cpp | 18 #include "cJSON.h" 36 cJSON* root = cJSON_Parse(policy.c_str()); in Deserialize() 40 cJSON* item; in Deserialize() 42 cJSON* bundleName = cJSON_GetObjectItem(item, BUNDLE_NAME); in Deserialize() 43 cJSON* accountId = cJSON_GetObjectItem(item, ACCOUNT_ID); in Deserialize() 44 cJSON* fileName = cJSON_GetObjectItem(item, FILE_NAME); in Deserialize() 45 cJSON* width = cJSON_GetObjectItem(item, WIDTH); in Deserialize() 46 cJSON* height = cJSON_GetObjectItem(item, HEIGHT); in Deserialize() 68 cJSON* root = nullptr; in Serialize() 71 cJSON* ite in Serialize() [all...] |
/base/startup/appspawn/test/moduletest/ |
H A D | appspawn_test_cmder.h | 27 #include "cJSON.h" 84 int AddExtTlv(const cJSON *appInfoConfig, AppSpawnReqMsgHandle reqHandle); 85 int BuildMsgFromJson(const cJSON *appInfoConfig, AppSpawnReqMsgHandle reqHandle); 86 int AddBundleInfoFromJson(const cJSON *appInfoConfig, AppSpawnReqMsgHandle reqHandle); 87 int AddDacInfoFromJson(const cJSON *appInfoConfig, AppSpawnReqMsgHandle reqHandle); 88 int AddInternetPermissionInfoFromJson(const cJSON *appInfoConfig, AppSpawnReqMsgHandle reqHandle); 89 int AddAccessTokenFromJson(const cJSON *appInfoConfig, AppSpawnReqMsgHandle reqHandle); 90 int AddDomainInfoFromJson(const cJSON *appInfoConfig, AppSpawnReqMsgHandle reqHandle); 91 uint32_t GetUint32ArrayFromJson(const cJSON *json, const char *name, uint32_t dataArray[], uint32_t maxCount); 111 cJSON *appInfoConfig [all...] |
/base/customization/enterprise_device_management/services/edm_plugin/src/ |
H A D | set_browser_policies_plugin.cpp | 96 cJSON* policies = nullptr; in SetRootPolicy() 104 cJSON* value = nullptr; in SetRootPolicy() 125 cJSON* policies = nullptr; in SetPolicy() 132 cJSON* policy = cJSON_GetObjectItem(policies, appid.c_str()); in SetPolicy() 153 ErrCode SetBrowserPoliciesPlugin::SetPolicyValue(cJSON* policy, std::string policyName, in SetPolicyValue() 157 cJSON* value = nullptr; in SetPolicyValue() 191 cJSON* policies = nullptr; in OnGetPolicy() 198 cJSON* policy = cJSON_GetObjectItem(policies, appId.c_str()); in OnGetPolicy() 245 cJSON* root = nullptr; in MergeBrowserPolicy() 262 bool SetBrowserPoliciesPlugin::AddBrowserPoliciesToRoot(cJSON* roo [all...] |
/base/startup/appspawn/lite/ |
H A D | appspawn_message.c | 29 #include "cJSON.h" 63 static enum OHOSLiteErrorCode ReadStringItem(cJSON *strItem, char **buf, size_t maxLen, size_t minLen) in ReadStringItem() 95 static double ReadNumberItem(cJSON *strItem) in ReadNumberItem() 104 static int GetCaps(const cJSON *curItem, MessageSt *msgSt) in GetCaps() 108 cJSON *capItem = cJSON_GetObjectItem(curItem, "capability"); in GetCaps() 133 cJSON *capJ = cJSON_GetArrayItem(capItem, i); in GetCaps() 165 cJSON *rootJ = cJSON_ParseWithLength(msg, msgLen); in SplitMessage() 171 cJSON *bundleNameItem = cJSON_GetObjectItem(rootJ, "bundleName"); in SplitMessage() 179 cJSON *identityIDItem = cJSON_GetObjectItem(rootJ, "identityID"); in SplitMessage() 187 cJSON *uIDIte in SplitMessage() [all...] |