I am reading the following file:
File.txt
Y:\Test\DOCUMENTS\DOCUMENTS\Flux Assurance 2\multi\ACTEPROC_OK\018-1-R.xml Y:\Test\DOCUMENTS\DOCUMENTS\Flux Assurance 2\multi\ACTEPROC_OK\A018-2-R.xml Y:\Test\DOCUMENTS\DOCUMENTS\Flux Assurance 2\multi\ACTEPROC_OK\021-1-R.xml Y:\Test\DOCUMENTS\DOCUMENTS\Flux Assurance 2\multi\ACTEPROC_OK\A021-2-R.xml Y:\Test\DOCUMENTS\DOCUMENTS\Flux Assurance 2\multi\ACTEPROC_OK\022-1-R.xml Y:\Test\DOCUMENTS\DOCUMENTS\Flux Assurance 2\multi\ACTEPROC_OK\022-2-R.xml Y:\Test\DOCUMENTS\DOCUMENTS\Flux Assurance 2\multi\ACTEPROC_OK\025-1-R.xml
Source code:
#include <iostream>
#include <vector>
#include <boost/iostreams/device/mapped_file.hpp>
#include <boost/iostreams/stream.hpp>
std::vector<string> readFile(string);
int main()
{
std::vector<string> res = readFile("file.txt");
return 0;
}
std::vector<string> readFile(string f)
{
boost::iostreams::stream<boost::iostreams::mapped_file_source> str(f);
std::vector<string> app;
for(string x; str >> x;)
{
app.push_back(x);
}
return app;
}//end
Problem:
Since There is a space Between Flux and Assurance 2, it considers space as a separator.
How can remove the separator, or explicitly identify what the separator is?