/commonlibrary/rust/ylong_json/src/value/object/ |
H A D | linked_list.rs | 90 /// Checks whether the specified key exists in the Object. 102 pub fn contains_key(&self, key: &str) -> bool { in contains_key() 103 self.get_cursor(key).is_some() in contains_key() 106 /// Inserts the specified key and value into an Object, appending them to the end without deduplication. 117 pub fn insert(&mut self, key: String, value: JsonValue) { in insert() 118 self.inner.push_back((key, value)) in insert() 121 /// Removes the element under the specified key from the Object.If there is an element with 134 pub fn remove(&mut self, key: &str) -> Option<JsonValue> { in remove() 135 self.get_cursor_mut(key)?.remove_current().map(|(_, v)| v) in remove() 164 /// Gets a common reference to the element in Object with the specified key in iter() [all...] |
H A D | btree.rs | 87 /// Checks whether the specified key exists in the Object. 99 pub fn contains_key(&self, key: &str) -> bool { in contains_key() 100 self.inner.contains_key(key) in contains_key() 103 /// Inserts the specified key and value into the Object, and replaces the value if the key already exists in the Object. 114 pub fn insert(&mut self, key: String, value: JsonValue) { in insert() 115 self.inner.insert(key, value); in insert() 130 pub fn remove(&mut self, key: &str) -> Option<JsonValue> { in remove() 131 self.inner.remove(key) in remove() 160 /// Gets a common reference to the element in Object with the specified key in iter() [all...] |
H A D | vec.rs | 92 /// Checks whether the specified key exists in the Object. 104 pub fn contains_key(&self, key: &str) -> bool { in contains_key() 105 self.inner.iter().any(|(k, _)| k == key) in contains_key() 108 /// Inserts the specified key and value into an Object, appending them to the end without deduplication. 119 pub fn insert(&mut self, key: String, value: JsonValue) { in insert() 120 self.inner.push((key, value)) in insert() 123 /// Removes the element under the specified key from the Object.If there is an element with 136 pub fn remove(&mut self, key: &str) -> Option<JsonValue> { in remove() 137 let pos = self.inner.iter().position(|(k, _)| k == key)?; in remove() 167 /// Gets a common reference to the element in Object with the specified key in iter() [all...] |
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/util/ |
H A D | slots.rs | 64 write!(f, "invalid key") in fmt() 85 let key = self.next; in push_back() 90 if key == self.entries.len() { in push_back() 93 self.next = key + 1; in push_back() 98 self.next = self.entries[key].next; in push_back() 99 self.entries[key].prev = tail; in push_back() 100 self.entries[key].next = NULL; in push_back() 101 self.entries[key].data = Some(val); in push_back() 106 self.head = key; in push_back() 109 entry.next = key; in push_back() [all...] |
/commonlibrary/c_utils/base/include/ |
H A D | safe_map.h | 51 V ReadVal(const K& key) in ReadVal() argument 54 return map_[key]; in ReadVal() 58 void ChangeValueByLambda(const K& key, LambdaCallback callback) in ChangeValueByLambda() argument 61 callback(map_[key]); in ChangeValueByLambda() 96 * @param key Indicates the key of the key-value (KV) pair to insert. 101 bool Insert(const K& key, const V& value) in Insert() argument 104 auto ret = map_.insert(std::pair<K, V>(key, value)); in Insert() 111 * @param key Indicate 116 EnsureInsert(const K& key, const V& value) EnsureInsert() argument 137 Find(const K& key, V& value) Find() argument 160 FindOldAndSetNew(const K& key, V& oldValue, const V& newValue) FindOldAndSetNew() argument 182 Erase(const K& key) Erase() argument [all...] |
/commonlibrary/utils_lite/js/builtin/kvstorekit/src/ |
H A D | nativeapi_kv.cpp | 30 bool IsValidKey(const char* key)
in IsValidKey() argument 32 if (key == nullptr) {
in IsValidKey() 35 size_t keyLen = strnlen(key, KEY_MAX_LEN + 1);
in IsValidKey() 39 if (strpbrk(key, "/\\\"*+,:;<=>\?[]|\x7F")) {
in IsValidKey() 45 int GetFullPath(const char* dataPath, const char* key)
in GetFullPath() argument 47 if (!IsValidKey(key) || (dataPath == nullptr)) {
in GetFullPath() 53 if (sprintf_s(g_kvFullPath, sizeof(g_kvFullPath), "%s/%s/%s", dataPath, DEFAULT_FOLDER_PATH, key) < 0) {
in GetFullPath() 73 int GetValueInner(const char* dataPath, const char* key, char* value)
in GetValueInner() argument 75 int ret = GetFullPath(dataPath, key);
in GetValueInner() 82 int SetValueInner(const char* dataPath, const char* key, cons argument 91 DeleteValueInner(const char* dataPath, const char* key) DeleteValueInner() argument 126 char* key = JSI::GetStringProperty(args, KV_KEY); ExecuteGet() local 166 char* key = JSI::GetStringProperty(args, KV_KEY); ExecuteSet() local 212 char* key = JSI::GetStringProperty(args, KV_KEY); ExecuteDelete() local [all...] |
H A D | nativeapi_kv_impl.c | 100 int GetValue(const char* key, char* value)
in GetValue() argument 102 if ((key == NULL) || (value == NULL)) {
in GetValue() 109 if (GetRealPath(key, resolvePath, PATH_MAX) != NATIVE_SUCCESS) {
in GetValue() 129 int SetValue(const char* key, const char* value)
in SetValue() argument 131 if ((key == NULL) || (!IsValidValue(value))) {
in SetValue() 138 if (GetRealPath(key, resolvePath, PATH_MAX) != NATIVE_SUCCESS) {
in SetValue() 153 int DeleteValue(const char* key)
in DeleteValue() argument 155 if (key == NULL) {
in DeleteValue() 158 if (unlink(key) != NATIVE_SUCCESS) {
in DeleteValue()
|
/commonlibrary/utils_lite/include/ |
H A D | kv_store.h | 20 * @brief Provides functions for obtaining, setting, and deleting a key-value pair.
24 * If {@link FEATURE_KV_CACHE} is enabled, key-value pairs can be stored in the cache. \n
26 * For details about the number of key-value pairs that can be stored in an application, see {@link MAX_KV_SUM}. \n
35 * @brief Provides functions for obtaining, setting, and deleting a key-value pair.
53 * @brief Obtains the value matching a specified key from the file system or cache.
55 * @param key Indicates the key to be indexed. It allows only lowercase letters, digits, underscores (_), and dots (.).
57 * @param value Indicates the buffer for storing the value that matches the key. This is an output parameter.
65 int UtilsGetValue(const char* key, char* value, unsigned int len);
68 * @brief Adds or updates the value matching a specified key i [all...] |
/commonlibrary/utils_lite/js/builtin/kvstorekit/include/ |
H A D | nativeapi_kv_impl.h | 29 int GetValue(const char* key, char* value);
30 int SetValue(const char* key, const char* value);
31 int DeleteValue(const char* key);
|
/commonlibrary/c_utils/base/test/unittest/common/ |
H A D | utils_safe_map_test.cpp | 271 * @tc.desc: 100 threads test in writein to the same key of the map, while read at same time and no throw 279 auto lamfuncInsert = [](SafeMap<string, int>& data, const string& key, in HWTEST_F() 282 data.EnsureInsert(key, value); in HWTEST_F() 285 auto lamfuncCheck = [](SafeMap<string, int>& data, const string& key, in HWTEST_F() 289 data.Find(key, i); in HWTEST_F() 296 string key("A"); in HWTEST_F() 299 threads[i] = std::thread(lamfuncInsert, std::ref(demoData), key, i, system_clock::from_time_t(timeT)); in HWTEST_F() 300 checkThread[i] = std::thread(lamfuncCheck, std::ref(demoData), key, system_clock::from_time_t(timeT)); in HWTEST_F() 316 * @tc.desc: 100 threads test in writein to the corresponding key of the map, 326 auto lamfuncInsert = [](SafeMap<string, int>& data, const string& key, in HWTEST_F() [all...] |
/commonlibrary/c_utils/base/test/benchmarktest/safe_map_benchmark_test/ |
H A D | safe_map_benchmark_test.cpp | 304 AssertEqual(valueA, INSERT_TWO, "Value for key \"A\" did not equal INSERT_TWO as expected.", state); in BENCHMARK_F() 309 AssertEqual(valueB, INSERT_THREE, "Value for key \"B\" did not equal INSERT_THREE as expected.", state); in BENCHMARK_F() 314 AssertEqual(valueC, INSERT_FOUR, "Value for key \"C\" did not equal INSERT_FOUR as expected.", state); in BENCHMARK_F() 319 AssertEqual(valueD, INSERT_FIVE, "Value for key \"D\" did not equal INSERT_FIVE as expected.", state); in BENCHMARK_F() 345 AssertEqual(valueOne, INSERT_ONE, "Value for key \"ONE\" did not match as expected.", state); in BENCHMARK_F() 346 AssertEqual(valueTwo, INSERT_TWO, "Value for key \"TWO\" did not match as expected.", state); in BENCHMARK_F() 372 AssertEqual(valueOne, INSERT_ONE, "Value for key \"ONE\" did not equal INSERT_ONE as expected.", state); in BENCHMARK_F() 373 AssertEqual(valueTwo, INSERT_TWO, "Value for key \"TWO\" did not equal INSERT_TWO as expected.", state); in BENCHMARK_F() 460 * @tc.desc: 100 threads test in writein to the same key of the map, while read at same time and no throw 469 auto lamfuncInsert = [](SafeMap<string, int>& data, const string& key, in BENCHMARK_F() [all...] |
/commonlibrary/rust/ylong_http/ylong_http_client/src/util/ |
H A D | pool.rs | 36 pub(crate) fn get<F>(&self, key: K, create_fn: F) -> V 41 match (*inner).entry(key) { 72 let key = PoolKey::new( in ut_pool_get() 79 let res = pool.get(key, consume_and_return_data); in ut_pool_get()
|
H A D | alt_svc.rs | 45 pub(crate) fn get_alt_svcs(&self, key: &PoolKey) -> Option<Vec<AltService>> { 47 let vec = lock.get_mut(key)?; 110 let key = PoolKey::new(scheme.clone(), authority.clone()); 118 lock.remove(&key); 128 lock.insert(key, new_alt_svcs);
|
H A D | test_utils.rs | 25 pub(crate) fn format_header_str(key: &str, value: &str) -> String { 26 format!("{}:{}\r\n", key.to_ascii_lowercase(), value)
|
H A D | dispatcher.rs | 513 for key in keys { 514 if let Some(mut task) = self.curr_message.remove(&key) { 519 self.senders.remove(&key); 520 if let Some(state) = self.streams.stream_state(key) { 522 if let StreamEndState::OK = self.streams.send_local_reset(key) { 526 key, 538 self.curr_message.insert(key, task);
|
/commonlibrary/ets_utils/js_concurrent_module/utils/ |
H A D | utils.cpp | 30 napi_value key; in InitGlobal() local 33 napi_create_string_utf8(env, valueName.c_str(), valueName.size(), &key); in InitGlobal() 34 napi_get_property(env, global, key, &value); in InitGlobal()
|
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/process/pty_process/ |
H A D | command.rs | 121 pub fn env<K: AsRef<OsStr>, V: AsRef<OsStr>>(&mut self, key: K, val: V) -> &mut PtyCommand { in env() 122 self.command.env(key, val); in env() 176 pub fn env_remove<K: AsRef<OsStr>>(&mut self, key: K) -> &mut PtyCommand { in env_remove() 177 self.command.env_remove(key); in env_remove()
|
/commonlibrary/rust/ylong_http/ylong_http_client/src/async_impl/ |
H A D | pool.rs | 63 let key = PoolKey::new( 69 let alt_svc = self.alt_svcs.get_alt_svcs(&key); 72 .get(key, Conns::new)
|
/commonlibrary/ets_utils/js_concurrent_module/common/helper/ |
H A D | concurrent_helper.cpp | 32 std::string key;
in ParseLine() local 35 if (iss >> key >> value >> unit) {
in ParseLine()
|
/commonlibrary/rust/ylong_http/ylong_http_client/src/sync_impl/ |
H A D | pool.rs | 40 let key = PoolKey::new( 46 .get(key, Conns::new)
|
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/sync/ |
H A D | wake_list.rs | 61 /// Removes the waker corresponding to the key. 62 pub fn remove(&self, key: usize) -> Result<Waker, SlotsError> { in remove() 64 inner.wake_list.remove(key) in remove()
|
/commonlibrary/rust/ylong_http/ylong_http_client/src/util/config/ |
H A D | http.rs | 244 fn insert_additional_settings(&mut self, key: u64, value: u64) { in insert_additional_settings() 246 vec.push((key, value)); in insert_additional_settings() 248 self.additional_settings = Some(vec![(key, value)]); in insert_additional_settings()
|
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/process/ |
H A D | command.rs | 148 pub fn env<K: AsRef<OsStr>, V: AsRef<OsStr>>(&mut self, key: K, val: V) -> &mut Command { in env() 149 self.std.env(key, val); in env() 202 pub fn env_remove<S: AsRef<OsStr>>(&mut self, key: S) -> &mut Command { in env_remove() 203 self.std.env_remove(key); in env_remove()
|
/commonlibrary/rust/ylong_http/ylong_http_client/src/async_impl/quic/ |
H A D | mod.rs | 145 let Some(key) = tls_config.pinning_host_match(stream.conn_detail().addr()) else { 149 if verify_server_cert(ssl.get_raw_ptr(), key.as_str()).is_ok() {
|
/commonlibrary/rust/ylong_json/benches/task_helpers/ |
H A D | mod.rs | 21 pub const OBJECT_EXAMPLE: &str = r#"{"key":"value"}"#;
|