Comments (5)
@clone2727 had a better idea: introduce a CachedSeekableReadStream
(or whatever it should be called) that basically reads into a dynamic memory area, so that it can provide true seeking.
Of course, that's the more complex solution that would be a bit more work than the quick fix I proposed above. Not sure I can give it adequate focus at the moment.
Btw, what exactly is your use-case? What temporary files are you generating and reading and why? Can you guide me through an full example run of what you're doing, so that I can understand what you need?
from xoreos-tools.
Oh, right, explicitly tagging @lachjames to make sure you actually see this :P
from xoreos-tools.
Thanks for creating this issue and tagging me in it 👍
Probably the main use case would be reading/editing/writing files (GFF obviously being the main target, but the container structures like RIM and MOD would be useful too (although probably beyond the scope of this issue as it would require more than redirecting stdin).
The text-reading ones (I guess the ones which convert from xml to a given format) are probably fine as you describe them (though admittedly I never thought to try using stdin for them as I assumed it wouldn't work). The ability to take a binary stream and pass it straight through stdin in the same fashion would be fantastic too.
A full example of the workflow I'm imagining would be as follows (for a KOTOR dialog editor):
- Read the .dlg file using gff2xml
- Modify the xml using the UI of the tool
- Save a .dlg file using xml2gff (or perhaps modify a RIM/MOD/ERF file to include it, but again that's beyond the scope of this issue - I might open another issue in relation to this).
Currently, the above workflow involves writing a gff file to disk (if reading it from a RIM/MOD/ERF) to read it with gff2xml, then writing the xml file to disk for xml2gff (though as you say, this is already not necessary).
I think any solution which allows a binary stream to be used as input would be fine. To be honest, the implementation details you discuss are a bit beyond my experience with reading/writing streams so I'll just say that I'm sure you'll make a fine judgement on the method which would be preferable :)
from xoreos-tools.
Okay, if you want to read GFFs from stdin, that already makes the easy approach moot, because you need proper seeking in GFFs.
That means the cached approach is the way to go. I can't promise when I'll get to that, though.
from xoreos-tools.
There's no rush at all on this; it's just a suggestion that would make the tool much more efficient when integrating it in our own code via subprocesses. As always, let me know if there's anything I can do to help out :)
from xoreos-tools.
Related Issues (20)
- xml2gff not included in xoreos-tools-0.0.5 release? HOT 7
- XML2GFF: Tool needs to be game/encoding aware HOT 1
- XML2GFF: Serialize color codes HOT 7
- NCSDIS: Control flow analysis failure in do-loop nested in while-loop HOT 15
- NCSDIS: Analyse control flow for recursive functions, and functions with incompatible fork merging HOT 1
- FEATURE: Compile xoreos-tools as a DLL/library HOT 6
- FEATURE: "File picker" for RIM/ERF/MOD files HOT 9
- ERF: MOD files have incorrect prefix HOT 4
- ERF: Recursion leads to infinite loop HOT 1
- Clarify XML format for xml2gff HOT 1
- GFF2XML -> XML2GFF (invalid base64 length) HOT 5
- UNOBB: Add support for KotOR2 Android obb archives HOT 29
- Issue running configure to build project: Syntax error near unexpected token `FT2 HOT 3
- xml2gff: NWN:EE invalid file format HOT 12
- error while compiling HOT 6
- another error while compiling HOT 1
- FEATURE: Add tool to convert TGA back to TPC
- CONVERT2DA: Code and documentation mismatch for the parameters HOT 5
- xml2tlk gives error when trying convert back cp1251 xml HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xoreos-tools.