Platforms to show: All Mac Windows Linux Cross-Platform
SCPreferencesMBS class
Super class: CFObjectMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | SystemConfiguration | MBS MacCF Plugin | 4.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Notes:
Please remember that you may need root access to change something.
The SCPreferences classes allow an application to load and store XML configuration data in a controlled manner and provide the necessary notifications to other applications that need to be aware of configuration changes.
The stored XML configuration data is accessed using a prefsID. A
nil value indicates that the default system preferences are to be accessed.
A string which starts with a leading "/" character specifies the path to the file containing te preferences to be accessed. A string which does not start with a leading "/" character specifies a file relative to the default system preferences directory.
The Path APIs make certain assumptions about the layout of the preferences data. These APIs view the data as a collection of dictionaries of key/value pairs and an associated path name. The root path ("/") identifies the top-level dictionary. Additional path components specify the keys for sub-dictionaries.
For example, the following dictionary can be accessed via two paths. The root ("/") path would return a dictionary with all keys and values. The path "/path1" would only return the dictionary with the "key3" and "key4" properties.
<dict>
<key>key1</key>
<string>val1</string>
<key>key2</key>
<string>val2</string>
<key>path1</key>
<dict>
<key>key3</key>
<string>val3</string>
<key>key4</key>
<string>val4</string>
</dict>
</dict>
Each dictionary can also include the kSCResvLink key. The value associated with this key is interpreted as a "link" to another path. If this key is present, a call to the GetPathValue() API will return the dictionary specified by the link.
Subclass of the CFObjectMBS class.
- 2 shared properties
- 20 methods
- method AddValue(key as CFStringMBS, value as CFObjectMBS) as boolean
- method ApplyChanges as boolean
- method CommitChanges as boolean
- method Create(name as CFStringMBS, prefid as CFStringMBS) as boolean
- method CreateUniquePathChild(prefix as CFStringMBS) as CFStringMBS
- method CreateWithAuthorization(name as CFStringMBS, prefid as CFStringMBS, AuthorizationHandle as Integer) as boolean
- method GetPathLink(path as CFStringMBS) as CFObjectMBS
- method GetPathValue(path as CFStringMBS) as CFDictionaryMBS
- method GetValue(key as CFStringMBS) as CFObjectMBS
- method KeyList as CFArrayMBS
- method Lock(wait as boolean) as boolean
- method RemovePathValue(path as CFStringMBS) as boolean
- method RemoveValue(key as CFStringMBS) as boolean
- method SetComputerName(name as CFStringMBS) as boolean
- method SetLocalHostName(name as CFStringMBS) as boolean
- method SetPathLink(path as CFStringMBS, link as CFObjectMBS) as boolean
- method SetPathValue(path as CFStringMBS, value as CFDictionaryMBS) as boolean
- method SetValue(key as CFStringMBS, value as CFObjectMBS) as boolean
- method Signature as CFBinaryDataMBS
- method Unlock as boolean
- shared method ErrorString(errorcode as Integer) as string
Super class CFObjectMBS
- 5 properties
- property Handle as Integer
- property Hash as Integer
- property Lasterror as Integer
- property Type as Integer
- property TypeDescription as String
- 9 methods
- method close
- method DeepCopy as CFObjectMBS
- method EncodedData as MemoryBlock
- method Equal(o as CFObjectMBS) as boolean
- method ReleaseObject
- method RetainCount as Integer
- method RetainObject
- method XML as CFBinaryDataMBS
- method XMLdata as String
- shared method NewCFObject(handle as Integer) as CFObjectMBS
This class has no sub classes.
Some examples using this class:
- /MacCF/MacOSXProxySettings
- /MacCF/SystemConfiguration/MacOSXProxySettings
- /MacCF/SystemConfiguration/Preferences Test
Blog Entries
The items on this page are in the following plugins: MBS MacCF Plugin.
