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

       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"

iolib.h File Reference

The iolib functions header file. More...

#include <vector>
#include <zlib.h>

Go to the source code of this file.

Classes

class  FileException
class  FileWriter
class  FileList
class  CFile

Defines

#define CL_OPEN_READ   0x1
#define CL_OPEN_WRITE   0x2
#define CL_WRITE_GZ   0x4

Enumerations

enum  { CLF_TYPE_INVALID, CLF_TYPE_PLAIN, CLF_TYPE_GZIP }

Functions

FileWriterCreateFileWriter (const std::string &filename)
char * LibraryFileName (const char *file, char *buffer, size_t buffersize)
 < Build libary path name
int ReadDataDirectory (const char *dirname, int(*filter)(char *, FileList *), std::vector< FileList > &flp)


Detailed Description

The iolib functions header file.

Definition in file iolib.h.


Define Documentation

#define CL_OPEN_READ   0x1

#define CL_OPEN_WRITE   0x2

Definition at line 122 of file iolib.h.

Referenced by PatchSaveButtonListener::action(), CommandLog(), CFile::open(), and SaveGame().

#define CL_WRITE_GZ   0x4

Definition at line 123 of file iolib.h.

Referenced by CFile::open(), and SaveGame().


Enumeration Type Documentation

anonymous enum

Enumerator:
CLF_TYPE_INVALID  invalid file handle
CLF_TYPE_PLAIN  plain text file handle
CLF_TYPE_GZIP  gzip file handle

Definition at line 115 of file iolib.h.


Function Documentation

FileWriter* CreateFileWriter ( const std::string &  filename  ) 

Create a file writer object that works for the given file name.

If the file name ends with '.gz', the file writer returned will compress the data with zlib.

Create FileWriter

Definition at line 592 of file iolib.cpp.

References strcasestr().

Referenced by WriteMapPresentation(), and WriteMapSetup().

char* LibraryFileName ( const char *  file,
char *  buffer,
size_t  buffersize 
)

< Build libary path name

Read the contents of a directory

Generate a filename into library.

Try current directory, user home directory, global directory.

Parameters:
file Filename to open.
buffer Allocated buffer for generated filename.
buffersize Size of the buffer
Returns:
Pointer to buffer.

Definition at line 364 of file iolib.cpp.

References _C_, DebugPrint, FindFileWithExtension(), sprintf_s(), StratagusLibPath, strcpy_s(), and UserDirectory.

Referenced by CclLoad(), CclLoadBuffer(), CreateGame(), CEditor::Init(), LoadCcl(), LoadGraphicPNG(), LoadPO(), LoadSample(), MenuLoop(), PlayMovie(), and PlayMusic().

int ReadDataDirectory ( const char *  dirname,
int(*)(char *, FileList *)  filter,
std::vector< FileList > &  fl 
)

Generate a list of files within a specified directory

Parameters:
dirname Directory to read.
filter Optional xdata-filter function.
fl Filelist pointer.
Returns:
the number of entries added to FileList.

Definition at line 417 of file iolib.cpp.

References int(), FileList::name, new_strdup(), strcat_s(), strcpy_s(), and FileList::type.

Referenced by CclFilteredListDirectory().


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