Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added functionality to fix broken XML. #1

Closed
wants to merge 22 commits into from
Closed

Conversation

@asr1
Copy link

@asr1 asr1 commented Jul 1, 2015

Presently fixUnclosedNodes only works for </UIButton>

@DrMcCoy
Copy link
Member

@DrMcCoy DrMcCoy commented Jul 1, 2015

Interesting to see this in progress. :)

When integrating this into xoreos-tools / xoreos proper, the interface should probably be something like for Aurora::Small, i.e. a method that consumes a Common::SeekableReadStream * and spits out a fixed Common::SeekableReadStream *. It should probably live in the Aurora namespace, too.

In the method, you would create a Common::MemoryWriteStreamDynamic [1] and writeString() your fixed strings into that. Of course, our stream classes are primed to read/write Common::UString instead of std::string [2], so you either need to write a custom readline() that reads into a std::string, or change the code to use Common::UString directly. You would need to rewrite lots of your function to use iterators instead of indices, though. And possibly add some required methods to Common::UString()?

[1] Which right now allocates memory in 32 byte blocks. I should probably change that so that it doubles it capacity each time, to amortize the costs for copying
[2] Since you're only checking for certain characters and keep the rest untouched / copied verbatim, your code is probably otherwise completely utf-8-safe with std::string

@DrMcCoy
Copy link
Member

@DrMcCoy DrMcCoy commented May 15, 2018

Hej, just wanted to check in. Will you still work on this? :)

If you don't have time, don't want to work on this anymore, or anything, it's of course completely fine.

If there is anything I can help you with, hit me up, either here, per email or IRC.

@asr1
Copy link
Author

@asr1 asr1 commented May 16, 2018

@DrMcCoy
Copy link
Member

@DrMcCoy DrMcCoy commented May 23, 2018

For some reason, the history of this PR/branch is really weird. 8edb21d is really huge? These two commits are a mess, to be honest.

Can you fix this? Alternatively, can you start from scratch with an up-to-date checkout from the current master branch and rebuild your changes on top?

@DrMcCoy
Copy link
Member

@DrMcCoy DrMcCoy commented May 23, 2018

There's also a lot of style things still wrong, and all source code filenames should be lowercase.

Please have a look through the Developer Central page on our wiki, especially the Code Formatting Conventions. If in doubt, look at how the existing code handles things. If still in doubt, always feel free to ask me; poke me here, on IRC or by mail. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants