Memory file processing C++ routines