____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
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"
#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 | |
| FileWriter * | CreateFileWriter (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) |
Definition in file iolib.h.
| #define CL_OPEN_READ 0x1 |
Definition at line 121 of file iolib.h.
Referenced by CEditor::Init(), LoadGraphicPNG(), LoadStratagusMap(), LoadVorbis(), LoadWav(), LuaLoadBuffer(), CFile::open(), PlayMovie(), and Screenshot().
| #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 |
| anonymous enum |
| 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.
| file | Filename to open. | |
| buffer | Allocated buffer for generated filename. | |
| buffersize | Size of the 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
| dirname | Directory to read. | |
| filter | Optional xdata-filter function. | |
| fl | Filelist pointer. |
Definition at line 417 of file iolib.cpp.
References int(), FileList::name, new_strdup(), strcat_s(), strcpy_s(), and FileList::type.
Referenced by CclFilteredListDirectory().
1.5.6