MCPcopy Create free account
hub / github.com/KhronosGroup/KTX-Software / InputStream

Class InputStream

tools/ktx/command.h:359–382  ·  view source on GitHub ↗

Helper to handle stdin and fstream uniformly

Source from the content-addressed store, hash-verified

357
358/// Helper to handle stdin and fstream uniformly
359class InputStream {
360 std::string filepath;
361 std::istream* activeStream = nullptr;
362 std::ifstream file; // Unused for stdin/stdout
363 std::stringstream stdinBuffer;
364
365public:
366 InputStream(const std::string& filepath, Reporter& report);
367
368 const std::string& str() {
369 return filepath;
370 }
371
372 /*explicit(false)*/ operator std::istream&() {
373 return *activeStream;
374 }
375
376 std::istream* operator->() {
377 return activeStream;
378 }
379 std::istream& operator*() {
380 return *activeStream;
381 }
382};
383
384/// Helper to handle stdout and fstream uniformly
385class OutputStream {

Callers 1

executeCompareMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected