Panda3D
|
This static class does the job of converting filenames from relative to absolute to canonical or whatever is appropriate. More...
#include "filenameUnifier.h"
Static Public Member Functions | |
static Filename | get_bam_filename (Filename filename) |
Returns an absolute pathname based on the given relative pathname, presumably read from the bam file and relative to the bam file. | |
static Filename | make_bam_filename (Filename filename) |
Returns a new filename that's made relative to the bam file itself, suitable for writing to the bam file. | |
static void | make_canonical (Filename &filename) |
Does the same thing as Filename::make_canonical()--it converts the filename to its canonical form--but caches the operation so that repeated calls to filenames in the same directory will tend to be faster. | |
static Filename | make_egg_filename (Filename filename) |
Returns a new filename that's made relative to the rel_directory, suitable for writing out within egg files. | |
static Filename | make_user_filename (Filename filename) |
Returns a new filename that's made relative to the current directory, suitable for reporting to the user. | |
static void | set_rel_dirname (const Filename &rel_dirname) |
Sets the name of the directory that texture filenames will be written relative to, when generating egg files. | |
static void | set_txa_filename (const Filename &txa_filename) |
Notes the filename the .txa file was found in. |
This static class does the job of converting filenames from relative to absolute to canonical or whatever is appropriate.
Its main purpose is to allow us to write relative pathnames to the bam file and turn them back into absolute pathnames on read, so that a given bam file does not get tied to absolute pathnames.
Definition at line 34 of file filenameUnifier.h.
Filename FilenameUnifier::get_bam_filename | ( | Filename | filename | ) | [static] |
Returns an absolute pathname based on the given relative pathname, presumably read from the bam file and relative to the bam file.
Definition at line 86 of file filenameUnifier.cxx.
Referenced by ImageFile::fillin(), EggFile::fillin(), and Palettizer::fillin().
Filename FilenameUnifier::make_bam_filename | ( | Filename | filename | ) | [static] |
Returns a new filename that's made relative to the bam file itself, suitable for writing to the bam file.
Definition at line 72 of file filenameUnifier.cxx.
References make_canonical().
Referenced by ImageFile::write_datagram(), EggFile::write_datagram(), and Palettizer::write_datagram().
void FilenameUnifier::make_canonical | ( | Filename & | filename | ) | [static] |
Does the same thing as Filename::make_canonical()--it converts the filename to its canonical form--but caches the operation so that repeated calls to filenames in the same directory will tend to be faster.
Definition at line 135 of file filenameUnifier.cxx.
References Filename::get_dirname().
Referenced by TextureImage::copy_unplaced(), make_bam_filename(), make_egg_filename(), make_user_filename(), set_rel_dirname(), and set_txa_filename().
Filename FilenameUnifier::make_egg_filename | ( | Filename | filename | ) | [static] |
Returns a new filename that's made relative to the rel_directory, suitable for writing out within egg files.
Definition at line 101 of file filenameUnifier.cxx.
References make_canonical().
Referenced by ImageFile::update_egg_tex().
Filename FilenameUnifier::make_user_filename | ( | Filename | filename | ) | [static] |
Returns a new filename that's made relative to the current directory, suitable for reporting to the user.
Definition at line 117 of file filenameUnifier.cxx.
References ExecutionEnvironment::get_cwd(), and make_canonical().
Referenced by PaletteImage::optimal_resize(), ImageFile::output_filename(), ImageFile::read(), EggFile::read_egg(), SourceTextureImage::read_header(), Palettizer::read_stale_eggs(), Palettizer::report_pi(), ImageFile::unlink(), PaletteImage::update_filename(), ImageFile::write(), EggFile::write_egg(), and TextureImage::write_scale_info().
void FilenameUnifier::set_rel_dirname | ( | const Filename & | rel_dirname | ) | [static] |
Sets the name of the directory that texture filenames will be written relative to, when generating egg files.
This is not the directory the textures are actually written to (see set_map_dirname()), but rather is the name of some directory above that, which will be the starting point for the pathnames written to the egg files. If this is empty, the full pathnames will be written to the egg files.
Definition at line 58 of file filenameUnifier.cxx.
References make_canonical().
Referenced by Palettizer::fillin().
void FilenameUnifier::set_txa_filename | ( | const Filename & | txa_filename | ) | [static] |
Notes the filename the .txa file was found in.
This may have come from the command line, or it may have been implicitly located. This has other implications for the FilenameUnifier, particularly in locating the bam file that saves the filenameUnifier state from last session.
Definition at line 36 of file filenameUnifier.cxx.
References Filename::get_dirname(), and make_canonical().