files.cc File Reference

#include "AppHdr.h"
#include "files.h"
#include <errno.h>
#include <string.h>
#include <string>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <algorithm>
#include <functional>
#include <fcntl.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "externs.h"
#include "abyss.h"
#include "act-iter.h"
#include "artefact.h"
#include "chardump.h"
#include "cloud.h"
#include "clua.h"
#include "coord.h"
#include "coordit.h"
#include "debug.h"
#include "delay.h"
#include "dgn-actions.h"
#include "dgn-overview.h"
#include "directn.h"
#include "dungeon.h"
#include "effects.h"
#include "env.h"
#include "errors.h"
#include "ghost.h"
#include "godpassive.h"
#include "initfile.h"
#include "items.h"
#include "jobs.h"
#include "kills.h"
#include "libutil.h"
#include "macro.h"
#include "mapmark.h"
#include "message.h"
#include "misc.h"
#include "mon-act.h"
#include "mon-death.h"
#include "mon-place.h"
#include "mon-iter.h"
#include "mon-stuff.h"
#include "mon-util.h"
#include "mon-transit.h"
#include "ng-init.h"
#include "notes.h"
#include "options.h"
#include "output.h"
#include "place.h"
#include "player.h"
#include "random.h"
#include "show.h"
#include "stash.h"
#include "state.h"
#include "stuff.h"
#include "syscalls.h"
#include "tags.h"
#include "terrain.h"
#include "travel.h"
#include "hints.h"
#include "viewgeom.h"
#include <dirent.h>

Classes

class  safe_file_writer

Defines

#define HAVE_STAT
#define SAVEFILE(file, savefn)
#define BONES_DIAGNOSTICS   (defined(WIZARD) || defined(DEBUG_BONES) | defined(DEBUG_DIAGNOSTICS))

Functions

bool is_save_file_name (const std::string &name)
bool save_exists (const std::string &name)
player_save_info read_character_info (package *save)
std::vector< std::stringget_dir_files (const std::string &dirname)
std::vector< std::stringget_dir_files_recursive (const std::string &dirname, const std::string &ext, int recursion_depth, bool include_directories)
std::vector< std::stringget_dir_files_ext (const std::string &dir, const std::string &ext)
std::string get_parent_directory (const std::string &filename)
std::string get_base_filename (const std::string &filename)
bool is_absolute_path (const std::string &path)
std::string catpath (const std::string &first, const std::string &second)
std::string get_path_relative_to (const std::string &referencefile, const std::string &relativepath)
std::string change_file_extension (const std::string &filename, 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 file_exists (const std::string &name)
bool dir_exists (const std::string &dir)
void assert_read_safe_path (const std::string &path) throw (std::string)
bool is_read_safe_path (const std::string &path)
std::string canonicalise_file_separator (const std::string &path)
std::string datafile_path (std::string basename, bool croak_on_fail, bool test_base_path, bool(*thing_exists)(const std::string &))
bool check_mkdir (const std::string &whatdir, std::string *dir, bool silent)
std::string get_savefile_directory (bool ignore_game_type)
std::string get_bonefile_directory (bool ignore_game_type)
std::string get_savedir_path (const std::string &shortpath)
std::string get_base_savedir ()
std::string get_base_savedir_path (const std::string &shortpath)
std::string savedir_versioned_path (const std::string &shortpath)
std::vector< player_save_infofind_all_saved_characters ()
std::vector< player_save_infofind_saved_characters ()
std::string get_savedir_filename (const std::string &prefix, const std::string &suffix, const std::string &extension, bool suppress_uid)
std::string get_save_filename (const std::string &prefix, const std::string &suffix, const std::string &extension, bool suppress_uid)
std::string get_prefs_filename ()
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 *farewellmsg)
void save_game_state ()
bool load_ghost (bool creating_level)
void restore_game (const std::string &name)
bool is_existing_level (const level_id &level)
bool get_save_version (reader &file, int &major, int &minor)
void save_ghost (bool force)
bool lock_file_handle (FILE *handle, bool write)
bool unlock_file_handle (FILE *handle)
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

const short GHOST_SIGNATURE = short(0xDC55)

Define Documentation

#define BONES_DIAGNOSTICS   (defined(WIZARD) || defined(DEBUG_BONES) | defined(DEBUG_DIAGNOSTICS))

#define HAVE_STAT

#define SAVEFILE ( file,
savefn   ) 

Value:

do                        \
    {                         \
        writer w(you.save, file);           \
        savefn(w);                \
    } while (false)


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 filename,
const std::string ext 
)

Here is the call graph for this function:

bool check_mkdir ( const std::string whatdir,
std::string dir,
bool  silent 
)

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,
bool  test_base_path,
bool(*)(const std::string &)  thing_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 (  ) 

std::string get_base_savedir_path ( const std::string shortpath  ) 

Here is the call graph for this function:

std::string get_bonefile_directory ( bool  ignore_game_type  ) 

Here is the call graph for this function:

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

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,
bool  include_directories 
)

Here is the call graph for this function:

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 prefix,
const std::string suffix,
const std::string extension,
bool  suppress_uid 
)

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 prefix,
const std::string suffix,
const std::string extension,
bool  suppress_uid 
)

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  ) 

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:

bool is_save_file_name ( const std::string name  ) 

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:

bool lock_file_handle ( FILE *  handle,
bool  write 
)

Here is the call graph for this function:

player_save_info read_character_info ( package save  ) 

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 *  farewellmsg 
)

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  ) 

Here is the call graph for this function:

std::string savedir_versioned_path ( const std::string shortpath  ) 

Here is the call graph for this function:

bool unlock_file_handle ( FILE *  handle  ) 

Here is the call graph for this function:


Variable Documentation

const short GHOST_SIGNATURE = short(0xDC55)


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