NVIDIA DeepStream SDK API Reference

6.4 Release
nvds_utils.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 NVIDIA Corporation. All rights reserved.
3  *
4  * NVIDIA Corporation and its licensors retain all intellectual property
5  * and proprietary rights in and to this software, related documentation
6  * and any modifications thereto. Any use, reproduction, disclosure or
7  * distribution of this software and related documentation without an express
8  * license agreement from NVIDIA Corporation is strictly prohibited.
9  *
10  */
11 
12 #ifndef __NVDS_COMMON_UTILS_H__
13 #define __NVDS_COMMON_UTILS_H__
14 
15 #ifdef __cplusplus
16 extern "C"
17 {
18 #endif
19 
20 /*
21  * Release memory allocated for gobjects
22  */
23 void free_gobjs(GKeyFile *gcfg_file, GError *error, gchar **keys, gchar *key_name);
24 
25 /*
26  * Internal function to verify if the config string value is a quoted string
27  * config key = "value"
28  * If so, strip beginning and ending quote
29  */
30 NvDsMsgApiErrorType strip_quote(char *cfg_value, const char *cfg_key, const char *LOG_CAT);
31 
32 /*
33  *Function to open a file and search config value for a config key
34  *If found, place the result in cfg_val
35  */
36 NvDsMsgApiErrorType fetch_config_value(char *config_path, const char *cfg_key, char *cfg_val, int len, const char *log_category);
37 
38 /*
39  *Generate hash value of a string using SHA256
40  */
41 std::string generate_sha256_hash(std::string str);
42 
43 /*
44  * remove leading & trailing whitespaces from a string
45  */
46 std::string trim(std::string str);
47 
48 /*
49  * Sort string of format key=value;key1=value1
50  * ex: str = "pq=89;xyz=33;abc=123;"
51  * output = "abc=123;pq=89;xyz=33"
52  */
53 std::string sort_key_value_pairs(std::string str);
54 
55 #ifdef __cplusplus
56 }
57 #endif
58 
59 #endif
trim
std::string trim(std::string str)
fetch_config_value
NvDsMsgApiErrorType fetch_config_value(char *config_path, const char *cfg_key, char *cfg_val, int len, const char *log_category)
NvDsMsgApiErrorType
NvDsMsgApiErrorType
Defines completion codes for operations in the messaging API.
Definition: nvds_msgapi.h:56
LOG_CAT
#define LOG_CAT
Definition: nvmsgbroker.h:27
strip_quote
NvDsMsgApiErrorType strip_quote(char *cfg_value, const char *cfg_key, const char *LOG_CAT)
sort_key_value_pairs
std::string sort_key_value_pairs(std::string str)
free_gobjs
void free_gobjs(GKeyFile *gcfg_file, GError *error, gchar **keys, gchar *key_name)
generate_sha256_hash
std::string generate_sha256_hash(std::string str)