____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
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 <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <fcntl.h>
#include "stratagus.h"
#include "iocompat.h"
#include "iolib.h"
Go to the source code of this file.
Classes | |
| class | RawFileWriter |
| class | GzFileWriter |
Functions | |
| static int | gzseek (CFile *file, unsigned offset, int whence) |
| static int | FindFileWithExtension (char *file, size_t filesize) |
| 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 > &fl) |
| FileWriter * | CreateFileWriter (const std::string &filename) |
Definition in file iolib.cpp.
| FileWriter* CreateFileWriter | ( | const std::string & | filename | ) |
Create FileWriter
Definition at line 592 of file iolib.cpp.
References strcasestr().
Referenced by WriteMapPresentation(), and WriteMapSetup().
| static int FindFileWithExtension | ( | char * | file, | |
| size_t | filesize | |||
| ) | [static] |
Find a file with its correct extension ("" or ".gz")
| file | The string with the file path. Upon success, the string is replaced by the full filename witht he correct extension. | |
| filesize | Size of the file buffer |
Definition at line 337 of file iolib.cpp.
References sprintf_s(), and strcpy_s().
Referenced by LibraryFileName().
| static int gzseek | ( | CFile * | file, | |
| unsigned | offset, | |||
| int | whence | |||
| ) | [static] |
Seek on compressed input. (Newer libs support it directly)
| file | File | |
| offset | Seek position | |
| whence | How to seek |
Definition at line 70 of file iolib.cpp.
Referenced by CFile::seek().
| 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.
| 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