mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-08 17:48:46 -10:00
* add subfolder support to cfile * sort files in VP archives before indexing them * fix indexing of sub-subfolders * remove unused 8B22K & 16B11K sound path types * add more items to skip subfolder scanning * fix windows build issues * fix unit tests by allowing 0-byte files to be indexed * fix file indexing on windows * add test for cfile subfolders * remove specific 'markup' and 'css' interface subfolders They aren't directly referenced anywhere by pathtype and the new subfolder code will continue to index and load files from them * add player binds to list of always-root locations * remove file-based localization support An alternative is left in place for old fonts, as that was the only place it appeared to be used. This method of file localization conflicts with subfolder support however so if it's needed in the future then changes to the subfolder code will be necessary. * add subfolder support to cf_find_file_location_ext() * add subfolder tests for cf_find_file_location*() * add shlwapi to needed win32 libs * small bit of cleanup * add subfolder support to cf_get_file_list() * add tests for cfile subfolder lists * report files that might be shadowed * fix issue with lists when a filter is used Also fixes discrepancy in older cf_get_file_list() when a sub path is specified (should be used in all cases, not just glob). * address review suggestions
50 lines
2.0 KiB
C
50 lines
2.0 KiB
C
/*
|
|
* Copyright (C) Volition, Inc. 1999. All rights reserved.
|
|
*
|
|
* All source code herein is the property of Volition, Inc. You may not sell
|
|
* or otherwise commercially exploit the source or things you created based on the
|
|
* source.
|
|
*
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _CFILESYSTEM_H
|
|
#define _CFILESYSTEM_H
|
|
|
|
#include "cfile/cfile.h"
|
|
|
|
// Builds a list of all the files
|
|
void cf_build_secondary_filelist( const char *cdrom_path );
|
|
void cf_free_secondary_filelist();
|
|
|
|
// Internal stuff
|
|
typedef struct cf_pathtype {
|
|
int index; // To verify that the CF_TYPE define is correctly indexed into this array
|
|
const char* path; // Path relative to FreeSpace root, has ending backslash.
|
|
const char* extensions; // Extensions used in this pathtype, separated by spaces
|
|
int parent_index; // Index of this directory's parent. Used for creating directories when writing.
|
|
} cf_pathtype;
|
|
|
|
// During cfile_init, verify that Pathtypes[n].index == n for each item
|
|
extern cf_pathtype Pathtypes[CF_MAX_PATH_TYPES];
|
|
|
|
bool cf_check_location_flags(uint32_t check_flags, uint32_t desired_flags);
|
|
|
|
// Returns the default storage path for files given a
|
|
// particular pathtype. In other words, the path to
|
|
// the unpacked, non-cd'd, stored on hard drive path.
|
|
// If filename isn't null it will also tack the filename
|
|
// on the end, creating a completely valid filename.
|
|
// Input: pathtype - CF_TYPE_??
|
|
// path_max - Maximum characters in the path
|
|
// filename - optional, if set, tacks the filename onto end of path.
|
|
// Output: path - Fully qualified pathname.
|
|
//Returns 0 if result would be too long (invalid result)
|
|
int cf_create_default_path_string(char* path, uint path_max, int pathtype, const char* filename = nullptr,
|
|
uint32_t location_flags = CF_LOCATION_ALL);
|
|
int cf_create_default_path_string(SCP_string& path, int pathtype, const char* filename = nullptr,
|
|
uint32_t location_flags = CF_LOCATION_ALL);
|
|
|
|
#endif //_CFILESYSTEM_H
|