/******************************************************************************
 * $Id: gfx_file.hh,v 1.22 2006/07/30 23:29:55 devel Exp $
 * @file
 * @author	Jim E. Brooks  http://www.jimbrooks.org
 * @brief	File functions.
 *//*
 * LEGAL:	COPYRIGHT (C) 2004 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE (GPL).
 ******************************************************************************/

#ifndef GFX_FILE_HH
#define GFX_FILE_HH 1

#include "gfx_misc.hh"

namespace gfx {

// Maximum pathname length.
const uint GFX_MAX_PATH = 256;

long
FileSize( FILE* file );

bool
ReadFile( const string& fname, string& obuf );

bool
ReadFile( const string& fname, StringBuf& strbuf );

#if GFX_ZLIB
bool
ReadFileGzip( const string& fname, string& obuf, const uint chunkLen = 256*1024 );
#endif

bool
RemoveFile( const string& fname );

void
RemoveSuffix( string& fname/*IN/OUT*/, const string& suffix );

bool
IfAbsPath( const string& path );

bool
FilesInDir( const string& dirname, vector<string>& vec /*OUT*/ );

void
Getcwd( string& out );

#if _WIN32
char
Unix2DosDirChar( char c );

string
Unix2DosDir( const string& dirname );
#endif // _WIN32

} // namespace gfx

#endif /* GFX_FILE_HH */
