You might have to help me through this, I need you to explain a few things about your code, if you don't mind ofcourse.
Code:
#include <algorithm>
....what's that there for?
Code:
typedef std::map<std::string, std::ifstream*> stream_map;
typedef std::map<std::string, std::vector<std::string> > contents_map;
...can you explain exactly what is going on here?
Code:
delete *iter->second;
....what's the ->second in there for?
Code:
file_streams[filename] = new std::ifstream(filename.c_str());
...i think i have an idea on what's going on here but can you explain it anyways?
Code:
friend std::ostream &operator << ( std::ostream &out, fmngr inst ) {
fmngr::contents_map::iterator iter( inst.file_contents.begin() ),
end ( inst.file_contents.end() );
for ( ; iter != end; iter ++ ) {
std::copy( iter->second.begin(),
iter->second.end(),
std::ostream_iterator<std::string>( out, " | " ) );
out<< "\n";
}
return out;
}
....i understand some of that but i decided to copy and paste all of it because i would still like to get it cleared up.
Thanks.