FS2_Open
Open source remastering of the Freespace 2 engine
cfilesystem.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) Volition, Inc. 1999. All rights reserved.
3  *
4  * All source code herein is the property of Volition, Inc. You may not sell
5  * or otherwise commercially exploit the source or things you created based on the
6  * source.
7  *
8 */
9 
10 
11 
12 #ifndef _CFILESYSTEM_H
13 #define _CFILESYSTEM_H
14 
15 #include "cfile/cfile.h"
16 
17 // Builds a list of all the files
18 void cf_build_secondary_filelist( const char *cdrom_path );
20 
21 // Internal stuff
22 typedef struct cf_pathtype {
23  int index; // To verify that the CF_TYPE define is correctly indexed into this array
24  char *path; // Path relative to FreeSpace root, has ending backslash.
25  char *extensions; // Extensions used in this pathtype, separated by spaces
26  int parent_index; // Index of this directory's parent. Used for creating directories when writing.
27 } cf_pathtype;
28 
29 // During cfile_init, verify that Pathtypes[n].index == n for each item
31 
32 // Returns the default storage path for files given a
33 // particular pathtype. In other words, the path to
34 // the unpacked, non-cd'd, stored on hard drive path.
35 // If filename isn't null it will also tack the filename
36 // on the end, creating a completely valid filename.
37 // Input: pathtype - CF_TYPE_??
38 // path_max - Maximum characters in the path
39 // filename - optional, if set, tacks the filename onto end of path.
40 // Output: path - Fully qualified pathname.
41 //Returns 0 if result would be too long (invalid result)
42 int cf_create_default_path_string( char *path, uint path_max, int pathtype, const char *filename=NULL, bool localize = false);
43 int cf_create_default_path_string( SCP_string &path, int pathtype, const char *filename=NULL, bool localize = false );
44 
45 #endif //_CFILESYSTEM_H
char * path
Definition: cfilesystem.h:24
void cf_build_secondary_filelist(const char *cdrom_path)
std::basic_string< char, std::char_traits< char >, std::allocator< char > > SCP_string
Definition: vmallocator.h:21
void cf_free_secondary_filelist()
unsigned int uint
Definition: pstypes.h:64
char * filename
int parent_index
Definition: cfilesystem.h:26
struct cf_pathtype cf_pathtype
char * extensions
Definition: cfilesystem.h:25
GLsizei const GLchar ** path
Definition: Glext.h:6795
#define CF_MAX_PATH_TYPES
Definition: cfile.h:82
int cf_create_default_path_string(char *path, uint path_max, int pathtype, const char *filename=NULL, bool localize=false)
cf_pathtype Pathtypes[CF_MAX_PATH_TYPES]
Definition: cfile.cpp:49