Natural Docs Version 1.2 |
NaturalDocs:: VersionA package for handling version information. What? That’s right. Although it should be easy and obvious, version numbers need to be dealt with in a variety of formats, plus there’s compatibility with older releases which handled it differently. I wanted to centralize the code after it started getting complicated. So there ya go. Summary
String FormatString versions are normally in the common major.minor format, with the exception of “1”. If the string is “1” and not “1.0”, it’s represents releases 0.85 through 0.91, since those had a separate version number for data files. We switched to using the app version number in 0.95. This issue does not apply to binary data files since they came after 0.95. Text files with “1” as the version will be interpreted as 0.91, since this should not cause compatibility problems. The only file format changes between 0.85 and 0.91 were to PreviousMenuState.nd, which didn’t exist in 0.85 and didn’t change between 0.9 and 0.91, and Menu.txt, which only changed in 0.9 to add index entries. Binary File FormatIn binary files, versions are two 8-bit unsigned values, appearing major then minor. The minor is always stored with two decimals, so 0.9 would be stored as 0 and 90. It’s in the Integer Format if interpreted as a big-endian 16-bit value. Text File FormatIn text files, versions are the String Format followed by a native line break. |
sub FromString #(string) |
sub FromBinaryFile #(fileHandle) |
sub FromTextFile #(fileHandle) |
sub ToString #(integer) |
| ||||||||||
| ||||||||||