src/p4ztag_to_json

The p4ztag_to_json module converts the Perforce P4 "Ztag" format to JSON.

References

Procs

proc ztagFileToJson(filename: string) {....raises: [IOError, KeyError, ValueError], tags: [
    ReadIOEffect, RootEffect, WriteIOEffect].}
Read input ztag file and convert/write to a JSON file.
proc ztagStringToJson(ztagStr: string): string {....raises: [KeyError, ValueError],
    tags: [RootEffect].}
Convert input ztag string to JSON.

Example:

let
  ztagString = """... abc d/e/f
... ghi 1.2.3

... abc j:k:l
... mno 456.789"""
  jsonString = """[
  {
    "abc": "d/e/f",
    "ghi": "1.2.3"
  },
  {
    "abc": "j:k:l",
    "mno": "456.789"
  }
]"""
doAssert ztagString.ztagStringToJson() == jsonString