Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data PlistBuddy a
- openPlist :: FilePath -> IO Plist
- data Plist
- send :: Plist -> PlistBuddy a -> IO a
- throwPlistError :: PlistError -> PlistBuddy a
- catchPlistError :: PlistBuddy a -> (PlistError -> PlistBuddy a) -> PlistBuddy a
- help :: PlistBuddy Text
- exit :: PlistBuddy ()
- save :: PlistBuddy ()
- revert :: PlistBuddy ()
- clear :: Value -> PlistBuddy ()
- get :: [Text] -> PlistBuddy Value
- set :: [Text] -> Value -> PlistBuddy ()
- add :: [Text] -> Value -> PlistBuddy ()
- delete :: [Text] -> PlistBuddy ()
- data Value
- valueType :: Value -> ByteString
- debugOn :: Plist -> Plist
- data PlistBuddyException = PlistBuddyException String
- data Trail
- data AuditTrail = AuditTrail ByteString [Trail] (Maybe ByteString)
- auditOn :: FilePath -> Plist -> IO Plist
- auditOff :: Plist -> IO ()
- replay :: Trail -> PlistBuddy ()
- recover :: FilePath -> IO [AuditTrail]
- hashcode :: FilePath -> IO ByteString
- findTrail :: ByteString -> [AuditTrail] -> [Trail]
- data BackgroundPlist
- backgroundPlist :: Int -> IO Plist -> IO BackgroundPlist
- bgSend :: BackgroundPlist -> PlistBuddy a -> IO a
- bgAutoSave :: BackgroundPlist -> IO ()
Remote Monad
data PlistBuddy a Source
The Remote Monad
send :: Plist -> PlistBuddy a -> IO a Source
throwPlistError :: PlistError -> PlistBuddy a Source
Throw a PlistError
. Uncaught PlistError
exceptions will
be thrown by send
as IO Exceptions.
catchPlistError :: PlistBuddy a -> (PlistError -> PlistBuddy a) -> PlistBuddy a Source
A version of catchError
with the type specialized to PlistBuddy. Using
this will cause a static error if used on a non-PlistBuddy monad.
The Remote Monad operators
help :: PlistBuddy Text Source
Returns Help Text
exit :: PlistBuddy () Source
Exits the program, changes are not saved to the file
save :: PlistBuddy () Source
Saves the current changes to the file
revert :: PlistBuddy () Source
Reloads the last saved version of the file
clear :: Value -> PlistBuddy () Source
Clear Type - Clears out all existing entries, and creates root of a value, where the value is an empty Dict or Array.
get :: [Text] -> PlistBuddy Value Source
Print Entry - Gets value of Entry.
set :: [Text] -> Value -> PlistBuddy () Source
Set Entry Value - Sets the value at Entry to Value You can not set dictionaries or arrays.
add :: [Text] -> Value -> PlistBuddy () Source
Add Entry Type [Value] - Adds Entry to the plist, with value Value You can add *empty* dictionaries or arrays.
delete :: [Text] -> PlistBuddy () Source
Delete Entry - Deletes Entry from the plist
Other types
valueType :: Value -> ByteString Source
Debugging
Exception
data PlistBuddyException Source
PlistBuddyException
is for fatal things,
like the sub-process blocks, for some reason.
Audit
data AuditTrail Source
replay :: Trail -> PlistBuddy () Source
replay
invokes the respective PlistBuddy
function. It is uses
when replying an audit replay.
recover :: FilePath -> IO [AuditTrail] Source
Find the list of PlistBuddy
commands to recover the plist.
Be careful when running recover with the audit capability turned on; it can duplicate
the audit trail, because recovery is also write. (This should not break anything)
hashcode :: FilePath -> IO ByteString Source
findTrail :: ByteString -> [AuditTrail] -> [Trail] Source
Background version of Plist
data BackgroundPlist Source
This is a version of Plist that saves the database on regular occasions, and suspends itself when not used.
backgroundPlist :: Int -> IO Plist -> IO BackgroundPlist Source
This creates a background Plist. The Int
argument is the number of seconds
to wait before saveing and sleeping the Plist. The 'IO Plist' may be called many times.
bgSend :: BackgroundPlist -> PlistBuddy a -> IO a Source
Send a command to a background Plist. The semantics of bgSend is the same as saving after every command, provided you wait long enough.
bgAutoSave :: BackgroundPlist -> IO () Source
Save (if needed) and exit. The BackgroundPlist goes to sleep.