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

Classes
iolib.h File Reference
#include <vector>
#include "SDL.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)
 
std::string LibraryFileName (const char *file)
 Build library path name. More...
 
bool CanAccessFile (const char *filename)
 
int ReadDataDirectory (const char *dirname, std::vector< FileList > &flp)
 Read the contents of a directory. More...
 
std::vector< std::string > QuoteArguments (std::vector< std::string > args)
 

Macro Definition Documentation

◆ CL_OPEN_READ

#define CL_OPEN_READ   0x1

◆ CL_OPEN_WRITE

#define CL_OPEN_WRITE   0x2

◆ CL_WRITE_BZ2

#define CL_WRITE_BZ2   0x8

◆ CL_WRITE_GZ

#define CL_WRITE_GZ   0x4

Enumeration Type Documentation

◆ anonymous enum

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

◆ CanAccessFile()

bool CanAccessFile ( const char *  filename)

◆ CreateFileWriter()

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

◆ LibraryFileName()

std::string LibraryFileName ( const char *  file)

Build library path name.

◆ QuoteArguments()

std::vector<std::string> QuoteArguments ( std::vector< std::string >  args)

Quote arguments for usage in calls to system(), popen() and similar. Really only needed on Windows, where all these calls just concatenate all arguments with a space and pass the full string to the next process.

◆ ReadDataDirectory()

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

Read the contents of a directory.

Generate a list of files within a specified directory

Parameters
dirnameDirectory to read.
flFilelist pointer.
Returns
the number of entries added to FileList.
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.