Commit Graph

43 Commits

Author SHA1 Message Date
Martchus 5ad00a083c Adapt to changes in c++utilities 2019-06-10 23:11:39 +02:00
Martchus 736b4caeeb Document handling different types and encodings 2019-06-01 23:20:01 +02:00
Martchus 5114a3ea08 Treat differently encoded values not necessarily as different
That an automatic conversion happens for different types but not
for different encodings was always a bit odd.

This makes writing tests easier and comparing values within the
tag editor does not rely on choosing a particular encoding.
2019-06-01 23:01:53 +02:00
Martchus a8e20c5ef4 Allow converting the description encoding 2019-06-01 22:57:01 +02:00
Martchus 8c88298fe8 Fix TagValue::operator== if 0 byte contained 2019-06-01 12:33:24 +02:00
Martchus 73adf26401 Fix conversion from PositionInSet to integer
Even though there was already a test verifying that it is
not possible.
2019-06-01 12:18:05 +02:00
Martchus 7efa7a0d5a Adapt to c++utilities v5 2019-05-04 16:04:21 +02:00
Martchus 296e5d11b6 Fix TagValue::toStandardGenreIndex() for empty genre index 2019-02-14 18:18:54 +01:00
Martchus 5140b76f08 Treat 255 as empty ID3v1 genre index 2019-02-13 18:56:03 +01:00
Martchus 3265e0bea4 Fix documentation which was still using the old namespace 2018-06-03 20:38:32 +02:00
Martchus 0a640c9f7f Fix warnings, mostly about implicit int conversions
This should fix all non-erros, leaving only warnings which
are indeed potential problems.

The following warnings should be safe to ignore:

* Conversions of various offsets from uint64 to
  std::streamoff/int64 are safe because such offsets have
  been obtained via tellg() and other functions
  returning std::streamoff in the first place.
* It also works vice-versa since tellg() should not
  return negative offsets with exceptions enabled.
* Conversions from char to unsigned char are also ok.
* Unused diag arguments can be ignored (those might be
  useful later).
* Annotate all intended fallthoughs.
2018-06-02 23:04:53 +02:00
Martchus f1656faa96 Fix TagValue::to{TimeSpan,DateTime}() for UTF-16 2018-06-02 19:23:07 +02:00
Martchus 09c1c6a232 Improve coding style in TagValue 2018-06-02 19:22:26 +02:00
Martchus fd1864c3df Make error messages in TagValue more specific 2018-06-02 19:21:15 +02:00
Martchus ca0b8e4d8c Improve coding style 2018-03-11 22:28:15 +01:00
Martchus 706c410edb Clear description encoding of TagValue 2018-03-11 22:27:55 +01:00
Martchus b35fc2ff0d Improve some structure layouts 2018-03-11 16:14:42 +01:00
Martchus a26b98dcd7 Improve TagValue
* Make more functions inline
* Fix use of std::size_t
2018-03-11 15:16:09 +01:00
Martchus c0336ed4bb Apply clang-format 2018-03-07 01:17:50 +01:00
Martchus 0e15c74103 Move everything into namespace TagParser 2018-03-06 23:09:15 +01:00
Martchus 646fc4d302 Fix TagValue::toInteger() from Latin1/UTF-8 str 2017-06-08 00:48:10 +02:00
Martchus 4e59ed2742 Mind encoding in TagValue::toStandardGenreIndex() 2017-06-03 21:00:36 +02:00
Martchus e1d14ad61b Allow conversion of DateTime in TagValue::toString() 2017-06-03 21:00:36 +02:00
Martchus 6c1a0b9126 Fix TagValue::toDateTime() 2017-06-03 21:00:36 +02:00
Martchus 6b705d5652 Mind encoding when converting TagValue to pos 2017-06-03 21:00:26 +02:00
Martchus b76d35acfd Mind encoding when converting TagValue to int 2017-06-03 21:00:26 +02:00
Martchus 39b63c84cb TagValue equality: Actually ignore encoding if not relevant 2017-06-03 21:00:26 +02:00
Martchus e925e15533 Improve handling of Unicode and BOM in ID3v2
* Convert UTF-8 text fields automatically to UTF-16
  when version is ID3v2.3 or below
  -> so conversion from ID3v2.4 to ID3v2.3 or below
     doesn't require manual conversion of possibly
     UTF-8 encoded fields
* Don't use magic numbers for ID3v2 encoding byte
* Don't warn about UTF-16 Big Endian with BOM
2017-05-20 23:34:45 +02:00
Martchus 8b9e800803 TagValue: Strip BOM from assigned text
* So everywhere else can be safely assumed that
  text values never have a BOM
* Only exceptions are move constructor and move
  assignment where the caller must ensure no BOM
  is present
2017-05-18 02:27:08 +02:00
Martchus c272ec315b Fix setting encoding in TagValue::assignText()
* when no conversion should to be done
* also be more tolerant in TagValue::toString() when
  no encoding has been specified
2016-12-28 00:17:26 +01:00
Martchus 369a241131 Fix character set conversion in TagValue::assignText 2016-12-27 23:39:32 +01:00
Martchus ed5dba0408 Add TagValue::operator!=(), improve doc for TagValue 2016-10-20 23:39:02 +02:00
Martchus d5c8086230 Improve misc details 2016-08-05 01:46:31 +02:00
Martchus 817a8e25e6 Improve documentation and consistency 2016-08-04 00:16:19 +02:00
Martchus 8663dedf8c Fix misc issues 2016-07-30 22:35:46 +02:00
Martchus 1e9df46691 Provide character set conversion for TagValue 2016-07-27 18:26:56 +02:00
Martchus 2c5d463a9f Improve API doc 2016-06-10 23:08:01 +02:00
Martchus b8e8dcd778 fixed some OGG/Vorbis related issues 2016-03-22 22:52:36 +01:00
Martchus 899e2a97fe small improvements
- fixed some mostly ID3/MP3 related bugs
- added convenience methods/operators
2016-03-18 21:43:09 +01:00
Martchus aa50c2d8b3 fixed includes 2015-09-06 19:57:33 +02:00
Martchus b1eb6faba6 fixed includes 2015-09-06 15:42:18 +02:00
Martchus 09fcb37442 small adjustments 2015-07-27 23:10:35 +02:00
Martchus 033e313c74 First commit 2015-04-22 19:22:01 +02:00