forked from Matir/adifparser
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: A byte-level parser is implemented to pick up ADIF tags and fields. This simplifies the parsing function. The old unused parser functions are removed. API function from adifparser application remains the same. ADIF field values now accept the byte information as is. This prevents processing errors when non-ASCII data is contained in the field, which is commonly happened among downloaded logs from QRZ.com. List of changes: * baseADIFReader.rdr is changed from io.Reader to *bufio.Reader - This does not break any adifparser application * baseADIFReader.version is changed from float64 to string - The version string is "3.1.3" now and this is apparently not a float * Add readElement() parser (as a method of baseADIFReader) - Add elementData struct as the return value definition * ReadRecord() is changed to use readElement() * readHeader() is changed to use readElement() * Removed the following unused functions: - readChunk() - readRecord() (beginning with the small r) - trimLotwEof() - ParseADIFRecord() - getNextField() * Revised the tests - Added tests for new functions - Removed tests for non-existing functions - Edited the old tests for new functions * Implemented non-Unicode tolower and toupper functions - These are required to preserve length of a byte slice - Go bytes.toLower() and bytes.toUpper() uses implicit UTF-8 case conversion, which changes the byte length of the processed byte slice, so these functions cannot be used
- Loading branch information
Showing
5 changed files
with
427 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.