/******************************************************************************
 * $Id: gfx_file.hh,v 1.24 2006/11/20 22:31:05 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
IfDirExists( const string& dirname );

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

void
Getcwd( string& out );

} // namespace gfx

#endif /* GFX_FILE_HH */
