XML2GFF: Add initial xml2gff tool #26
Conversation
You're going C++11 mode now, with that range-based for? :P Our Travis CI config is not yet adapted for that. But yes, I did say that I'm opening xoreos-tools up for C++11, so I guess it's time I put my money where my mouth is. I'll see if I find time to change that during the week. :) |
Yeah, i was not sure, if i should correct this, since travis failed. |
* Creates GFFs out of XML files. | ||
*/ | ||
|
||
#include <src/common/error.h> |
DrMcCoy
Oct 7, 2018
Member
#include ""
for our own files, please
#include ""
for our own files, please
#include <src/common/error.h> | ||
#include "src/xml/xmlparser.h" | ||
|
||
#include "gffcreator.h" |
DrMcCoy
Oct 7, 2018
Member
Full paths, please
Full paths, please
reinterpret_cast<char*>(&typeId)[3 - i] = *type.getPosition(i); | ||
else | ||
reinterpret_cast<char*>(&typeId)[3 - i] = ' '; | ||
} |
DrMcCoy
Oct 7, 2018
Member
That's...pretty icky. Can you use MKTAG()
instead?
You don't even need the loop, you can just pad the string with 4 spaces beforehand.
Like
const Common::UString type = xmlRoot.getProperty("type") + " ";
const uint32 typeID = MKTAG(*type.getPosition(0), ...
(Theoretically, you could even use Common::UString::at() from a6f1c2b)
That's...pretty icky. Can you use MKTAG()
instead?
You don't even need the loop, you can just pad the string with 4 spaces beforehand.
Like
const Common::UString type = xmlRoot.getProperty("type") + " ";
const uint32 typeID = MKTAG(*type.getPosition(0), ...
(Theoretically, you could even use Common::UString::at() from a6f1c2b)
void readStructContents(const XMLNode::Children &strctNodes, Aurora::GFF3WriterStructPtr strctPtr); | ||
void readListContents(const XMLNode::Children &listNodes, Aurora::GFF3WriterListPtr listPtr); | ||
|
||
Common::ScopedPtr<Aurora::GFF3Writer> _gff3; |
DrMcCoy
Oct 7, 2018
Member
Hmm, can you push the state into the method parameters, and make create()
static?
Hmm, can you push the state into the method parameters, and make create()
static?
uint32 language; | ||
Common::parseString(child->getProperty("language"), language); | ||
|
||
// TODO: Add gender if available. |
DrMcCoy
Oct 7, 2018
Member
Can you fulfill this TODO first? I'd rather not have a tool available that accidentally removes information when doing a round-trip
Can you fulfill this TODO first? I'd rather not have a tool available that accidentally removes information when doing a round-trip
src/version/libversion.la \ | ||
$(LDADD) \ | ||
$(EMPTY) | ||
|
DrMcCoy
Oct 7, 2018
Member
Can you add the binary (both Unix and Windows) to the .gitignore file too, please?
(Also, a manpage would be great as well)
Can you add the binary (both Unix and Windows) to the .gitignore file too, please?
(Also, a manpage would be great as well)
Parser parser(argv[0], "XML to BioWare GFF converter", | ||
"If no input file is given, the input is read from stdin.\n\n" | ||
"Since different games use different SSF file version, specifying the\n" | ||
"game for which to create the SSF file is necessary.", |
DrMcCoy
Oct 7, 2018
Member
That's obviously wrong for a GFF tool :P
That's obviously wrong for a GFF tool :P
} | ||
|
||
void createGFF(const Common::UString &inFile, const Common::UString &outFile) { | ||
Common::WriteFile ssf(outFile); |
DrMcCoy
Oct 7, 2018
Member
Also not the right variable name here :P
Also not the right variable name here :P
The issues should now be fixed and I added a man page |
Merged as 367563e...41aaf31, thanks! :) |
This adds an initial xml2gff tool. I modified the gff3 writer, taken from xoreos, slightly, so it won't require glm