I have a C++ application which has a Parser class used to parse this tag file; code below
1 2 3 4 5 6 7 8 9 10 11 12
ifstream input(inputFileName); // inputFileName is test.tag
class Parser
{
ifstream& _input; // _input holds a reference to ifstream
Parser(ifstream& infile) : _input(infile)
// Other member functions and data used to read each line of test.tag and then parse it.
};
Parser obj(input); // Create the Parser object
Now, i want to use the same Parser class but this time i have the file contents in memory (say char* poBuffer) instead of disk.
I would like to know which stream object sahould i create and how can i create the Parser object this time.