I am trying to map a file to memory and then parse line by line- is istream what I should be using?
Is istream the same as mapping a file to memory on Windows? I have had difficulties trying to find a complete example of mapping a file into memory.
I have seen people link memory mapping articles from MSDN, but if anybody could recommend a small (~15 line?) example I would be most thankful.
I must be searching for the wrong thing, but when searching "C++ memory mapping example" on Google, I could not find an example that included iterating through.
These were the closest results (just so people realize I have looked):
- http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2044.html#ClassSharedMemoryObjectExample
- http://msdn.microsoft.com/en-us/library/dd997372.aspx (no C++ code)
- https://beej.us/guide/bgipc/html/multi/mmap.html (was for Unix I believe, not Windows)