I have to build a program that reads the name of an XML data file on the command line, then opens that file and processes its data.
I have already done the function that can process the data, but I cannot get the program to open the file and store it in an "istream" stream (which is required). Here's what the main() looks like:
C:\>program.exe datafile.xml
int main( int argc, char *argv[] )
{
string FileName = argv[1];
***missing code to put the data in istream***
void processData( istream& inStream ){...}
return 0;
}
So, if anybody knows how to put the content of datafile.xml into inStream so it can be processed, that would really help me!!
I have already done the function that can process the data, but I cannot get the program to open the file and store it in an "istream" stream (which is required). Here's what the main() looks like:
C:\>program.exe datafile.xml
int main( int argc, char *argv[] )
{
string FileName = argv[1];
***missing code to put the data in istream***
void processData( istream& inStream ){...}
return 0;
}
So, if anybody knows how to put the content of datafile.xml into inStream so it can be processed, that would really help me!!