____                _       __
    / __ )____  _____   | |     / /___ ___________
   / __  / __ \/ ___/   | | /| / / __ `/ ___/ ___/
  / /_/ / /_/ (__  )    | |/ |/ / /_/ / /  (__  )
 /_____/\____/____/     |__/|__/\__,_/_/  /____/

       A futuristic real-time strategy game.
          This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project. Distributed under the "GNU General Public License"

CFile Class Reference

#include <iolib.h>

List of all members.

Public Member Functions

 CFile ()
 ~CFile ()
int open (const char *name, long flags)
int close ()
void flush ()
int read (void *buf, size_t len)
int seek (long offset, int whence)
long tell ()
int printf (const char *format,...)


Detailed Description

Defines a library file

Todo:
zip archive support

Definition at line 96 of file iolib.h.


Constructor & Destructor Documentation

CFile::CFile (  ) 

Definition at line 47 of file iolib.cpp.

References CLF_TYPE_INVALID.

CFile::~CFile (  ) 

Definition at line 52 of file iolib.cpp.

References CLF_TYPE_INVALID, close(), and DebugPrint.


Member Function Documentation

int CFile::open ( const char *  name,
long  openflags 
)

CLopen Library file open

Parameters:
name File name.
openflags Open read, or write and compression options
Returns:
File Pointer

Definition at line 91 of file iolib.cpp.

References Assert, CL_OPEN_READ, CL_OPEN_WRITE, CL_WRITE_GZ, CLF_TYPE_GZIP, CLF_TYPE_INVALID, CLF_TYPE_PLAIN, and DebugPrint.

Referenced by PatchSaveButtonListener::action(), CEditor::Init(), LoadGraphicPNG(), LoadStratagusMap(), LoadVorbis(), LoadWav(), LuaLoadBuffer(), PlayMovie(), SaveGame(), and Screenshot().

int CFile::close (  ) 

void CFile::flush (  ) 

Definition at line 200 of file iolib.cpp.

References CLF_TYPE_GZIP, CLF_TYPE_INVALID, and CLF_TYPE_PLAIN.

Referenced by AppendLog().

int CFile::read ( void *  buf,
size_t  len 
)

CLread Library file read

Parameters:
buf Pointer to read the data to.
len number of bytes to read.

Definition at line 181 of file iolib.cpp.

References CLF_TYPE_GZIP, CLF_TYPE_INVALID, and CLF_TYPE_PLAIN.

Referenced by CL_png_read_data(), LoadVorbis(), LoadWav(), LuaLoadBuffer(), OggGetNextPage(), OggInit(), and CSampleWavStream::Read().

int CFile::seek ( long  offset,
int  whence 
)

CLseek Library file seek

Parameters:
offset Seek position
whence How to seek

Definition at line 285 of file iolib.cpp.

References CLF_TYPE_GZIP, CLF_TYPE_INVALID, CLF_TYPE_PLAIN, and gzseek().

Referenced by LoadVorbis(), LoadWav(), OggInit(), and CSampleWavStream::Read().

long CFile::tell (  ) 

CLtell Library file tell

Definition at line 308 of file iolib.cpp.

References CLF_TYPE_GZIP, CLF_TYPE_INVALID, and CLF_TYPE_PLAIN.

Referenced by LoadVorbis().

int CFile::printf ( const char *  format,
  ... 
)


The documentation for this class was generated from the following files:

Generated on Sat Feb 21 00:28:23 2009 for Bos Wars by  doxygen 1.5.6