I try to read the plist / xml file which is behind the terminal commando:
defaults read com.apple.dock
NSUserDefaults
You can use CFPreferences, for example
CFStringRef orient = (CFStringRef) CFPreferencesCopyAppValue( CFSTR("orientation"), CFSTR("com.apple.dock") );
Boolean hidesIsValid = false;
Boolean hides = CFPreferencesGetAppBooleanValue( CFSTR("autohide"), CFSTR("com.apple.dock"), &hidesIsValid );