src/iwork/container

Source   Edit  

Types

ContainerKind = enum
  ckZip,                    ## single-file zip document
  ckBundle                   ## directory bundle
physical layout of a document on disk Source   Edit  
DocKind = enum
  dkKeynote,                ## a .key presentation
  dkPages,                  ## a .pages word processing document
  dkNumbers                  ## a .numbers spreadsheet
which application a document belongs to Source   Edit  
IworkContainer = ref object
  path*: string              ## the path the container was opened from
  kind*: ContainerKind       ## zip file or directory bundle
  docKind*: DocKind          ## detected application
an opened document container with its entries loaded Source   Edit  

Procs

proc iwaEntries(c: IworkContainer): seq[string] {....raises: [], tags: [],
    forbids: [].}
paths of all .iwa entries in the container Source   Edit  
proc metadataPlist(c: IworkContainer): string {....raises: [], tags: [],
    forbids: [].}
raw bytes of Metadata/Properties.plist, or "" if the entry is absent Source   Edit  
proc openContainer(path: string): IworkContainer {....raises: [IworkContainerError,
    OSError, IOError, ZippyError, KeyError, IworkUnsupportedError, Exception], tags: [
    ReadDirEffect, ReadIOEffect, ReadEnvEffect, WriteIOEffect, WriteDirEffect,
    RootEffect], forbids: [].}
opens a keynote, pages, or numbers document (zip or directory bundle) Source   Edit  
proc readEntry(c: IworkContainer; path: string): string {.
    ...raises: [IworkContainerError, KeyError], tags: [], forbids: [].}
Source   Edit