// Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // // $Id: m_fileio.h 4469 2014-01-03 23:38:29Z dr_sean $ // // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 2006-2014 by The Odamex Team. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // DESCRIPTION: // File Input/Output Operations // //----------------------------------------------------------------------------- #ifndef __M_FILEIO__ #define __M_FILEIO__ #include #include #include #include "doomtype.h" #include "d_main.h" SDWORD M_FileLength (FILE *f); bool M_FileExists(const std::string& filename); BOOL M_WriteFile(std::string filename, void *source, QWORD length); QWORD M_ReadFile(std::string filename, BYTE **buffer); BOOL M_AppendExtension (std::string &filename, std::string extension, bool if_needed = true); void M_ExtractFilePath(const std::string& filename, std::string &dest); bool M_ExtractFileExtension(const std::string& filename, std::string &dest); void M_ExtractFileBase (std::string filename, std::string &dest); void M_ExtractFileName (std::string filename, std::string &dest); std::string M_ExtractFileName(const std::string filename); #endif