$treeview $search $mathjax
Stratagus  2.2.6
$projectbrief
$projectbrief
$searchbox
-->
         _________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
           Stratagus - A free fantasy real time strategy game engine

src/include/iolib.h File Reference

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

Go to the source code of this file.


Classes

class  FileException
class  FileWriter
class  FileList
class  CFile

iolib.h - The iolib functions header file.

#define CL_OPEN_READ   0x1
#define CL_OPEN_WRITE   0x2
#define CL_WRITE_GZ   0x4
#define CL_WRITE_BZ2   0x8
enum  { CLF_TYPE_INVALID, CLF_TYPE_PLAIN, CLF_TYPE_GZIP, CLF_TYPE_BZIP2 }
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)
 Read the contents of a directory.

Define Documentation

#define CL_OPEN_READ   0x1

#define CL_OPEN_WRITE   0x2

#define CL_WRITE_BZ2   0x8

#define CL_WRITE_GZ   0x4


Enumeration Type Documentation

anonymous enum

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

bzip2 file handle


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

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

Build libary path name.

Generate a filename into library.

Try current directory, user home directory, global directory. This supports .gz, .bz2 and .zip.

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

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

Read the contents of a directory.

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.

(C) Copyright 1998-2011 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.