src/iwork/cellstorage

Search:
Group by:
Source   Edit  

Types

CellKind = enum
  ckEmpty,                  ## no value in the cell
  ckText,                   ## plain text
  ckNumber,                 ## numeric value as float64
  ckBool,                   ## boolean
  ckDate,                   ## calendar date/time
  ckDuration,               ## time span in seconds
  ckFormula,                ## formula cell (display text or a marker)
  ckError                    ## cell that failed to decode or holds an error
Source   Edit  
CellValue = object
  case kind*: CellKind
  of ckEmpty:
    nil
  of ckText:
    text*: string
  of ckNumber:
    number*: float64
  of ckBool:
    boolean*: bool
  of ckDate:
    date*: DateTime
  of ckDuration:
    durationSeconds*: float64
  of ckFormula:
    formula*: string
  of ckError:
    error*: string
one decoded table cell Source   Edit  

Procs

proc asString(v: CellValue): string {....raises: [], tags: [], forbids: [].}
human-readable form of a cell value, also used for csv output Source   Edit  
proc cellOffsets(offsets: string): seq[int] {....raises: [], tags: [], forbids: [].}
unpacks the little-endian uint16 per-column offsets buffer; 0xffff means the column has no cell in this row Source   Edit  
proc decodeCellAt(buf: string; offset: int; strings: Table[uint32, string]): CellValue {.
    ...raises: [Exception, KeyError], tags: [RootEffect], forbids: [].}
decodes one v5 cell record at a byte offset; anything unexpected logs at debug level and comes back as an error/empty value instead of raising, so one weird cell never kills the document Source   Edit