|
Odamex
Setting the Standard in Multiplayer Doom
|
00001 // Emacs style mode select -*- C++ -*- 00002 //----------------------------------------------------------------------------- 00003 // 00004 // $Id: m_fileio.h 1788 2010-08-24 04:42:57Z russellrice $ 00005 // 00006 // Copyright (C) 1993-1996 by id Software, Inc. 00007 // Copyright (C) 2006-2010 by The Odamex Team. 00008 // 00009 // This program is free software; you can redistribute it and/or 00010 // modify it under the terms of the GNU General Public License 00011 // as published by the Free Software Foundation; either version 2 00012 // of the License, or (at your option) any later version. 00013 // 00014 // This program is distributed in the hope that it will be useful, 00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 // GNU General Public License for more details. 00018 // 00019 // DESCRIPTION: 00020 // File Input/Output Operations 00021 // 00022 //----------------------------------------------------------------------------- 00023 00024 #ifndef __M_FILEIO__ 00025 #define __M_FILEIO__ 00026 00027 #include <string> 00028 #include <vector> 00029 00030 #include <stdio.h> 00031 00032 #include "doomtype.h" 00033 #include "d_main.h" 00034 00035 SDWORD M_FileLength (FILE *f); 00036 BOOL M_FileExists (std::string filename); 00037 00038 BOOL M_WriteFile(std::string filename, void *source, QWORD length); 00039 QWORD M_ReadFile(std::string filename, BYTE **buffer); 00040 00041 BOOL M_AppendExtension (std::string &filename, std::string extension, bool if_needed = true); 00042 void M_ExtractFilePath (std::string filename, std::string &dest); 00043 BOOL M_ExtractFileExtension (std::string filename, std::string &dest); 00044 void M_ExtractFileBase (std::string filename, std::string &dest); 00045 void M_ExtractFileName (std::string filename, std::string &dest); 00046 00047 #endif