files.h File Reference

#include "externs.h"
#include "player.h"
#include <stdio.h>
#include <string>
#include <vector>
#include <set>

Include dependency graph for files.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  level_excursion
class  file_lock
class  SavefileCallback

Defines

#define MAX_LEVELS   50

Typedefs

typedef std::set< level_idlevel_id_set

Enumerations

enum  load_mode_type { LOAD_START_GAME, LOAD_RESTART_GAME, LOAD_ENTER_LEVEL, LOAD_VISITOR }

Functions

bool file_exists (const std::string &name)
bool dir_exists (const std::string &dir)
bool is_absolute_path (const std::string &path)
bool is_read_safe_path (const std::string &path)
void assert_read_safe_path (const std::string &path) throw (std::string)
std::vector< std::stringget_dir_files (const std::string &dir)
std::vector< std::stringget_dir_files_ext (const std::string &dir, const std::string &ext)
std::vector< std::stringget_dir_files_recursive (const std::string &dirname, const std::string &ext="", int recursion_depth=-1, bool include_directories=false)
std::string datafile_path (std::string basename, bool croak_on_fail=true, bool test_base_path=false, bool(*thing_exists)(const std::string &)=file_exists)
bool get_dos_compatible_file_name (std::string *fname)
std::string get_parent_directory (const std::string &filename)
std::string get_base_filename (const std::string &filename)
std::string get_path_relative_to (const std::string &referencefile, const std::string &relativepath)
std::string catpath (const std::string &first, const std::string &second)
std::string canonicalise_file_separator (const std::string &path)
bool check_mkdir (const std::string &what, std::string *dir, bool silent=false)
std::vector< player_save_infofind_all_saved_characters ()
std::vector< player_save_infofind_saved_characters ()
std::string get_savefile_directory (bool ignore_game_type=false)
std::string get_bonefile_directory (bool ignore_game_type=false)
std::string get_save_filename (const std::string &pre, const std::string &suf, const std::string &ext, bool suppress_uid=false)
std::string get_savedir_filename (const std::string &pre, const std::string &suf, const std::string &ext, bool suppress_uid=false)
std::string get_base_savedir_path (const std::string &subpath="")
std::string get_savedir_path (const std::string &shortpath)
std::string savedir_versioned_path (const std::string &subdirs="")
std::string get_prefs_filename ()
std::string change_file_extension (const std::string &file, const std::string &ext)
void file_touch (const std::string &file)
time_t file_modtime (const std::string &file)
bool is_newer (const std::string &a, const std::string &b)
void check_newer (const std::string &target, const std::string &dependency, void(*action)())
bool load (dungeon_feature_type stair_taken, load_mode_type load_mode, const level_id &old_level)
void save_game (bool leave_game, const char *bye=NULL)
void save_game_state ()
bool get_save_version (reader &file, int &major, int &minor)
bool save_exists (const std::string &name)
void restore_game (const std::string &name)
bool is_existing_level (const level_id &level)
void save_ghost (bool force=false)
bool load_ghost (bool creating_level)
FILE * lk_open (const char *mode, const std::string &file)
void lk_close (FILE *handle, const char *mode, const std::string &file)
FILE * fopen_replace (const char *name)

Variables

level_id_set Generated_Levels


Define Documentation

#define MAX_LEVELS   50


Typedef Documentation

typedef std::set<level_id> level_id_set


Enumeration Type Documentation

Enumerator:
LOAD_START_GAME 
LOAD_RESTART_GAME 
LOAD_ENTER_LEVEL 
LOAD_VISITOR 


Function Documentation

void assert_read_safe_path ( const std::string path  )  throw (std::string)

Here is the call graph for this function:

std::string canonicalise_file_separator ( const std::string path  ) 

Here is the call graph for this function:

std::string catpath ( const std::string first,
const std::string second 
)

std::string change_file_extension ( const std::string file,
const std::string ext 
)

Here is the call graph for this function:

bool check_mkdir ( const std::string what,
std::string dir,
bool  silent = false 
)

Here is the call graph for this function:

void check_newer ( const std::string target,
const std::string dependency,
void(*)()  action 
)

Here is the call graph for this function:

std::string datafile_path ( std::string  basename,
bool  croak_on_fail = true,
bool  test_base_path = false,
bool(*)(const std::string &)  thing_exists = file_exists 
)

Here is the call graph for this function:

bool dir_exists ( const std::string dir  ) 

bool file_exists ( const std::string name  ) 

time_t file_modtime ( const std::string file  ) 

void file_touch ( const std::string file  ) 

std::vector<player_save_info> find_all_saved_characters (  ) 

Here is the call graph for this function:

std::vector<player_save_info> find_saved_characters (  ) 

Here is the call graph for this function:

FILE* fopen_replace ( const char *  name  ) 

std::string get_base_filename ( const std::string filename  ) 

Here is the call graph for this function:

std::string get_base_savedir_path ( const std::string subpath = ""  ) 

Here is the call graph for this function:

std::string get_bonefile_directory ( bool  ignore_game_type = false  ) 

Here is the call graph for this function:

std::vector<std::string> get_dir_files ( const std::string dir  ) 

std::vector<std::string> get_dir_files_ext ( const std::string dir,
const std::string ext 
)

Here is the call graph for this function:

std::vector<std::string> get_dir_files_recursive ( const std::string dirname,
const std::string ext = "",
int  recursion_depth = -1,
bool  include_directories = false 
)

Here is the call graph for this function:

bool get_dos_compatible_file_name ( std::string fname  ) 

std::string get_parent_directory ( const std::string filename  ) 

Here is the call graph for this function:

std::string get_path_relative_to ( const std::string referencefile,
const std::string relativepath 
)

Here is the call graph for this function:

std::string get_prefs_filename (  ) 

Here is the call graph for this function:

std::string get_save_filename ( const std::string pre,
const std::string suf,
const std::string ext,
bool  suppress_uid = false 
)

Here is the call graph for this function:

bool get_save_version ( reader file,
int &  major,
int &  minor 
)

Here is the call graph for this function:

std::string get_savedir_filename ( const std::string pre,
const std::string suf,
const std::string ext,
bool  suppress_uid = false 
)

Here is the call graph for this function:

std::string get_savedir_path ( const std::string shortpath  ) 

Here is the call graph for this function:

std::string get_savefile_directory ( bool  ignore_game_type = false  ) 

Here is the call graph for this function:

bool is_absolute_path ( const std::string path  ) 

bool is_existing_level ( const level_id level  ) 

bool is_newer ( const std::string a,
const std::string b 
)

Here is the call graph for this function:

bool is_read_safe_path ( const std::string path  ) 

Here is the call graph for this function:

void lk_close ( FILE *  handle,
const char *  mode,
const std::string file 
)

Here is the call graph for this function:

FILE* lk_open ( const char *  mode,
const std::string file 
)

Here is the call graph for this function:

bool load ( dungeon_feature_type  stair_taken,
load_mode_type  load_mode,
const level_id old_level 
)

bool load_ghost ( bool  creating_level  ) 

Here is the call graph for this function:

void restore_game ( const std::string name  ) 

Here is the call graph for this function:

bool save_exists ( const std::string name  ) 

Here is the call graph for this function:

void save_game ( bool  leave_game,
const char *  bye = NULL 
)

Here is the call graph for this function:

void save_game_state (  ) 

Here is the call graph for this function:

void save_ghost ( bool  force = false  ) 

Here is the call graph for this function:

std::string savedir_versioned_path ( const std::string subdirs = ""  ) 

Here is the call graph for this function:


Variable Documentation


Generated on Thu Jan 13 13:05:16 2011 by  doxygen 1.5.6