Skip to content

Commit

Permalink
Multiple qol improvements (#1)
Browse files Browse the repository at this point in the history
* Add SpliceInfoSection.Table() for formatted tabular output

* Export methods to compute flag state
  • Loading branch information
blahspam authored Jul 7, 2021
1 parent 9b42f92 commit 6bdbb29
Show file tree
Hide file tree
Showing 25 changed files with 927 additions and 366 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.DS_Store
.idea
.vscode
23 changes: 19 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
# Changelog

## [1.0.0] - 2021-07-01
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

## [1.1.0] - 2021-07-07

### Added

### Notes
* Added `SpliceInfoSection.Table(prefix, indent)` to format tabular output.

* Added methods for computing `_flag` values.

* Added latest specification and XML schema to /docs

## [1.0.0] - 2021-07-01

* Migrate from internal repository
### Added

* Remove internal comcast references
* Add code from internal repository
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Binary signals can be quickly and easily decoded from base-64 or hexadecimal
strings.

The results can be output as a:
* String - emulating the table structure used in the [SCTE 35 specification](./docs/SCTE-35_2020.pdf).
* String - emulating the table structure used in the [SCTE 35 specification](./docs/ANSI_SCTE-35-2020.pdf).
* XML - compliant with the [SCTE 35 XML Schema](./docs/scte35.xsd)
* JSON - for integrating with JSON based tools such as [jq](https://stedolan.github.io/jq/)

Expand All @@ -56,11 +56,11 @@ func main() {
_, _ = fmt.Fprintf(os.Stdout, "\nDetails: \n%s\n", sis)

// xml
b, _ := xml.MarshalIndent(sis, "", " ")
b, _ := xml.MarshalIndent(sis, "", "\t")
_, _ = fmt.Fprintf(os.Stdout, "\nXML: \n%s\n", b)

// json
b, _ = json.MarshalIndent(sis, "", " ")
b, _ = json.MarshalIndent(sis, "", "\t")
_, _ = fmt.Fprintf(os.Stdout, "\nJSON: \n%s\n", b)
}
```
Expand Down
6 changes: 3 additions & 3 deletions cmd/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ func decodeCommand() *cobra.Command {
// print details (sis is never nil)
switch format {
case "json":
b, _ := json.MarshalIndent(sis, "", " ")
b, _ := json.MarshalIndent(sis, "", "\t")
_, _ = fmt.Fprintf(os.Stdout, "%s\n", b)
case "xml":
b, _ := xml.MarshalIndent(sis, "", " ")
b, _ := xml.MarshalIndent(sis, "", "\t")
_, _ = fmt.Fprintf(os.Stdout, "%s\n", b)
default:
_, _ = fmt.Fprintf(os.Stdout, "%s\n", sis)
_, _ = fmt.Fprintf(os.Stdout, "%s\n", sis.Table("", "\t"))
}

// and any errors
Expand Down
Binary file added docs/ANSI_SCTE-35-2020.pdf
Binary file not shown.
Loading

0 comments on commit 6bdbb29

Please sign in to comment.