dirfiles-0.1.0.9

Safe HaskellNone

Data.Library

Synopsis

Documentation

type Library = Seq LibraryItemSource

A Library is just a rebranded Seq

type ItemId = IntSource

data LibraryItem Source

An item in the library

Constructors

Deleted 
Item 

Fields

itemId :: !ItemId
 
itemName :: !Text256
 
itemDescription :: !(Maybe Text4096)
 
itemDateCreated :: !UTCTime
 
itemDateModified :: !UTCTime
 
itemParent :: !ItemId
 
itemType :: !(Either Directory UUIRI)
 

data Error Source

Some errors that might occur

Instances

Eq Error 
Ord Error 
Show Error 
Typeable Error 
SafeCopy Error 

empty :: UTCTime -> LibrarySource

move :: Library -> ItemId -> ItemId -> UTCTime -> Either Error LibrarySource

copy :: Library -> ItemId -> ItemId -> UTCTime -> Either Error LibrarySource

rename :: Library -> ItemId -> Text -> UTCTime -> LibrarySource

Changes the name of an item

describe :: Library -> ItemId -> Text -> UTCTime -> LibrarySource

Sets the description of an item

touch :: Library -> ItemId -> UTCTime -> LibrarySource

Sets the modified date of an item to the one supplied in arg t

new :: Text -> Maybe Text -> UTCTime -> ItemId -> Maybe UUIRI -> Library -> Either Error LibrarySource

Create a new item in the library If createing a directory then uuiri must be Nothing

unsafeGetItem :: ItemId -> Library -> LibraryItemSource

No bounds checking and doesn't filter deleted items returns an exception error when the item is not found

getItem :: ItemId -> Library -> Either Error LibraryItemSource

Does bounds checking and also checks if the item was not deleted

getItemMaybe :: ItemId -> Maybe Library -> Either Error LibraryItemSource

getItem tailored to return an Error if the 2nd argument is Nothing