Question

I am writing a Preview Handler for a file with custom extension.

The Preview Handler implements IInitializeWithStream interface which initializes IStream with file data which has been selected in windows explorer.

Now, I need to perform some parsing operations on this data stream (the data in the file is plain text in a predefined custom format).

In order to do that, I need the data in std::ifstream object so that i can easily use STL on it to achieve the desired output.

Long Story Short: I need a way to convert/fill the data from IStream to std::ifstream.

Thanks in advance.

Était-ce utile?

La solution

I used the Read method of IStream interface to fill the data into char buffer and stream it into std::ostringstream using "<<" operator

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top