Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
The Json backend.
Synopsis
- delete :: forall env m. (HasCallStack, HasTrashHome env, MonadAsync m, MonadCatch m, MonadFileWriter m, MonadIORef m, MonadLoggerNS m, MonadPathReader m, MonadPathWriter m, MonadPosixCompat m, MonadReader env m, MonadTerminal m, MonadTime m) => UniqueSeqNE (PathI TrashEntryOriginalPath) -> m ()
- permDelete :: forall env m. (HasCallStack, HasTrashHome env, MonadAsync m, MonadCatch m, MonadFileReader m, MonadHandleWriter m, MonadIORef m, MonadPathReader m, MonadPathWriter m, MonadLoggerNS m, MonadReader env m, MonadPosixCompat m, MonadTerminal m) => Bool -> UniqueSeqNE (PathI TrashEntryFileName) -> m ()
- emptyTrash :: forall m env. (HasCallStack, HasTrashHome env, MonadAsync m, MonadCatch m, MonadFileReader m, MonadHandleWriter m, MonadLoggerNS m, MonadPathReader m, MonadPathWriter m, MonadPosixCompat m, MonadReader env m, MonadTerminal m) => Bool -> m ()
- restore :: forall env m. (HasCallStack, HasTrashHome env, MonadAsync m, MonadCatch m, MonadIORef m, MonadFileReader m, MonadLoggerNS m, MonadPathReader m, MonadPathWriter m, MonadPosixCompat m, MonadReader env m, MonadTerminal m) => UniqueSeqNE (PathI TrashEntryFileName) -> m ()
- getIndex :: forall env m. (HasCallStack, HasTrashHome env, MonadAsync m, MonadCatch m, MonadFileReader m, MonadPathReader m, MonadLoggerNS m, MonadReader env m, MonadPosixCompat m, MonadTerminal m) => m Index
- getMetadata :: forall m env. (HasCallStack, HasTrashHome env, MonadAsync m, MonadCatch m, MonadFileReader m, MonadLoggerNS m, MonadPathReader m, MonadPosixCompat m, MonadReader env m, MonadTerminal m) => m Metadata
- merge :: (HasCallStack, MonadFileReader m, MonadIORef m, MonadLoggerNS m, MonadMask m, MonadPathReader m, MonadPathWriter m) => PathI TrashHome -> PathI TrashHome -> m ()
- toRosetta :: (HasTrashHome env, MonadAsync m, MonadCatch m, MonadLoggerNS m, MonadFileReader m, MonadPathReader m, MonadPosixCompat m, MonadReader env m, MonadTerminal m) => m Rosetta
- fromRosetta :: (HasCallStack, MonadLoggerNS m, MonadFileReader m, MonadFileWriter m, MonadIORef m, MonadMask m, MonadPathReader m, MonadPathWriter m) => PathI TrashHome -> Rosetta -> m ()
- isJson :: (HasCallStack, MonadCatch m, MonadLoggerNS m, MonadPathReader m) => PathI TrashHome -> m (Maybe Bool)
Delete
delete :: forall env m. (HasCallStack, HasTrashHome env, MonadAsync m, MonadCatch m, MonadFileWriter m, MonadIORef m, MonadLoggerNS m, MonadPathReader m, MonadPathWriter m, MonadPosixCompat m, MonadReader env m, MonadTerminal m, MonadTime m) => UniqueSeqNE (PathI TrashEntryOriginalPath) -> m () Source #
delete trash p
moves path p
to the given trash location trash
and
writes an entry in the trash index. If the trash location is not given,
defaults to XDG data e.g. ~/.localsharecharon/
.
permDelete :: forall env m. (HasCallStack, HasTrashHome env, MonadAsync m, MonadCatch m, MonadFileReader m, MonadHandleWriter m, MonadIORef m, MonadPathReader m, MonadPathWriter m, MonadLoggerNS m, MonadReader env m, MonadPosixCompat m, MonadTerminal m) => Bool -> UniqueSeqNE (PathI TrashEntryFileName) -> m () Source #
Permanently deletes the paths from the trash.
emptyTrash :: forall m env. (HasCallStack, HasTrashHome env, MonadAsync m, MonadCatch m, MonadFileReader m, MonadHandleWriter m, MonadLoggerNS m, MonadPathReader m, MonadPathWriter m, MonadPosixCompat m, MonadReader env m, MonadTerminal m) => Bool -> m () Source #
Empties the trash.
Restore
restore :: forall env m. (HasCallStack, HasTrashHome env, MonadAsync m, MonadCatch m, MonadIORef m, MonadFileReader m, MonadLoggerNS m, MonadPathReader m, MonadPathWriter m, MonadPosixCompat m, MonadReader env m, MonadTerminal m) => UniqueSeqNE (PathI TrashEntryFileName) -> m () Source #
restore trash p
restores the trashed path <trash>/p
to its original
location.
Information
getIndex :: forall env m. (HasCallStack, HasTrashHome env, MonadAsync m, MonadCatch m, MonadFileReader m, MonadPathReader m, MonadLoggerNS m, MonadReader env m, MonadPosixCompat m, MonadTerminal m) => m Index Source #
Reads the index at either the specified or default location. If the file does not exist, returns empty.
getMetadata :: forall m env. (HasCallStack, HasTrashHome env, MonadAsync m, MonadCatch m, MonadFileReader m, MonadLoggerNS m, MonadPathReader m, MonadPosixCompat m, MonadReader env m, MonadTerminal m) => m Metadata Source #
Retrieves metadata for the trash directory.
Transformations
merge :: (HasCallStack, MonadFileReader m, MonadIORef m, MonadLoggerNS m, MonadMask m, MonadPathReader m, MonadPathWriter m) => PathI TrashHome -> PathI TrashHome -> m () Source #
Rosetta
toRosetta :: (HasTrashHome env, MonadAsync m, MonadCatch m, MonadLoggerNS m, MonadFileReader m, MonadPathReader m, MonadPosixCompat m, MonadReader env m, MonadTerminal m) => m Rosetta Source #
fromRosetta :: (HasCallStack, MonadLoggerNS m, MonadFileReader m, MonadFileWriter m, MonadIORef m, MonadMask m, MonadPathReader m, MonadPathWriter m) => PathI TrashHome -> Rosetta -> m () Source #
Existence
isJson :: (HasCallStack, MonadCatch m, MonadLoggerNS m, MonadPathReader m) => PathI TrashHome -> m (Maybe Bool) Source #
Determines if the backend is Json. The semantics are if the trash is
a well-formed json backend and it has at least one file with the
extension .json, then we return Just True
(definitely true).
If the trash does not exist or is not well-formed, we return Just False
(definitely false).
If the trash is a well-formed json backend but we do not have any files we return Nothing (maybe), because we cannot tell. It could be any backend that shares the same trash structure, including json.