File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -168,6 +168,25 @@ impl SCDynamicStore {
168
168
}
169
169
}
170
170
171
+ /// Returns the keys that represent the current dynamic store entries that match the specified
172
+ /// pattern. Or `None` if an error occured.
173
+ ///
174
+ /// `pattern` - A regular expression pattern used to match the dynamic store keys.
175
+ pub fn get_keys < S : Into < CFString > > ( & self , pattern : S ) -> Option < CFArray < CFString > > {
176
+ let cf_pattern = pattern. into ( ) ;
177
+ unsafe {
178
+ let array_ref = SCDynamicStoreCopyKeyList (
179
+ self . as_concrete_TypeRef ( ) ,
180
+ cf_pattern. as_concrete_TypeRef ( ) ,
181
+ ) ;
182
+ if array_ref != ptr:: null ( ) {
183
+ Some ( CFArray :: wrap_under_create_rule ( array_ref) )
184
+ } else {
185
+ None
186
+ }
187
+ }
188
+ }
189
+
171
190
/// If the given key exists in the store, the associated value is returned.
172
191
///
173
192
/// Use `CFPropertyList::downcast` to cast the result into the correct type.
You can’t perform that action at this time.
0 commit comments