Пример #1
0
void StringLookups::Open(STRING FileName, boost::iostreams::mapped_file_source &file_map)
{
    try
    {
        file_map.open(FileName);
    }
    catch(std::ios::failure const &ex)
    {
        printer("StringLookups: Error - Unable to open \"%s\" as read only via memory mapping. The file is probably open in another application.\n", FileName);
        throw ex;
    }
    catch(std::exception &ex)
    {
        printer("StringLookups: Error - Unable to open \"%s\" as read only via memory mapping.\n", FileName);
        throw ex;
    }
    catch(...)
    {
        printer("StringLookups: Error - Unable to open \"%s\" as read only via memory mapping.  An unhandled exception occurred.\n", FileName);
        throw;
    }
}