NWN file formats in C++
![Liareth](https://forums.beamdog.com/uploads/userpics/438/nNNGZ9OFJPS3D.png)
I wanted a decent way to read NWN file formats in C++ for personal NWN-related projects so I decided to write a library to handle it. It's open source and completely free for anyone to copy, use, and change with or without attribution. It should compile and work on all platforms and x86 architectures (probably not on ARM though) but I haven't tried it on Linux so there may be a few compile fixes needed there.
Note that this is a library for C++ developers who want to parse Aurora engine file formats, and right now only GFF is implemented.
https://github.com/Liareth/NWNFileFormats
You can see how it works here:
https://github.com/Liareth/NWNFileFormats/blob/master/Examples/Example_Gff.cpp
Note that this is a library for C++ developers who want to parse Aurora engine file formats, and right now only GFF is implemented.
https://github.com/Liareth/NWNFileFormats
You can see how it works here:
https://github.com/Liareth/NWNFileFormats/blob/master/Examples/Example_Gff.cpp
10
Comments
Example:
https://github.com/Liareth/NWNFileFormats/blob/master/Examples/Example_Erf.cpp
Of course, coding convention is in the eye of the beholder, and I am stuck with this asserting null pointers at work too, which might be why I am so sensitive
I do prefer references in most cases, but for functions that take out parameters, I prefer raw pointers because it's more explicit to me that the intent is to return a value that way. In this library, I've used raw pointers only for out parameters (Gff/Erf::ReadFromBytes and Gff::ReadField), and everything else takes references. I'm not allowed to use exceptions at work
https://github.com/Liareth/NWNFileFormats/blob/master/Examples/Example_KeyBifExtractor.cpp
https://github.com/Liareth/NWNFileFormats/blob/master/Examples/Example_Key.cpp
https://github.com/Liareth/NWNFileFormats/blob/master/Examples/Example_Bif.cpp
@GreenWarlock I played around with compiling it on Clang today. You need Clang 5.0 or later. I use the unstable branch of Debian which has Clang 6.0 and GCC 7.2 available as a package, both of which compile the library out of the box.
If you have a manual compiler install, you can do it like:
CC=/usr/bin/clang-6.0 CXX=/usr/bin/clang++-6.0 ./build.sh
TR
TR
-Dave
Is your code based on bioware_aurora_engine_file_formats.zip? Or, is there an updated reference I missed somewhere?
Thanks and, thanks for the work!
Thanks.
That's what I thought (backwards compatible and all). But, I wanted to confirm.