Panda3D
Public Member Functions

ConfigVariableFilename Class Reference

This is a convenience class to specialize ConfigVariable as a Filename type. More...

#include "configVariableFilename.h"

Inheritance diagram for ConfigVariableFilename:
ConfigVariable ConfigVariableBase ConfigFlags

List of all members.

Public Member Functions

 ConfigVariableFilename (const string &name)
 ConfigVariableFilename (const string &name, const Filename &default_value, const string &description=string(), int flags=0)
const char * c_str () const
bool empty () const
string get_basename () const
 Returns the basename part of the filename.
string get_basename_wo_extension () const
 Returns the basename part of the filename, without the file extension.
Filename get_default_value () const
 Returns the variable's default value.
string get_dirname () const
 Returns the directory part of the filename.
string get_extension () const
 Returns the file extension.
string get_fullpath () const
 Returns the entire filename: directory, basename, extension.
string get_fullpath_wo_extension () const
 Returns the full filename--directory and basename parts--except for the extension.
Filename get_value () const
 Returns the variable's value.
Filename get_word (int n) const
 Returns the variable's nth value.
size_t length () const
 operator const Filename & () const
 Returns the variable's value as a Filename.
bool operator!= (const Filename &other) const
bool operator< (const Filename &other) const
void operator= (const Filename &value)
 Reassigns the variable's local value.
bool operator== (const Filename &other) const
char operator[] (int n) const
void set_value (const Filename &value)
 Reassigns the variable's local value.
void set_word (int n, const Filename &value)
 Reassigns the variable's nth value.

Detailed Description

This is a convenience class to specialize ConfigVariable as a Filename type.

It is almost the same thing as ConfigVariableString, except it handles an implicit Filename::expand_from() operation so that the user may put OS-specific filenames, or filenames based on environment variables, in the prc file.

Definition at line 30 of file configVariableFilename.h.


Member Function Documentation

string ConfigVariableFilename::get_basename ( ) const [inline]

Returns the basename part of the filename.

This is everything in the filename after the rightmost slash, including any extensions.

Definition at line 142 of file configVariableFilename.I.

References Filename::get_basename().

string ConfigVariableFilename::get_basename_wo_extension ( ) const [inline]

Returns the basename part of the filename, without the file extension.

Definition at line 166 of file configVariableFilename.I.

References Filename::get_basename_wo_extension().

Filename ConfigVariableFilename::get_default_value ( ) const [inline]

Returns the variable's default value.

Reimplemented from ConfigVariable.

Definition at line 243 of file configVariableFilename.I.

References ConfigDeclaration::get_string_value().

string ConfigVariableFilename::get_dirname ( ) const [inline]

Returns the directory part of the filename.

This is everything in the filename up to, but not including the rightmost slash.

Definition at line 130 of file configVariableFilename.I.

References Filename::get_dirname().

string ConfigVariableFilename::get_extension ( ) const [inline]

Returns the file extension.

This is everything after the rightmost dot, if there is one, or the empty string if there is not.

Definition at line 179 of file configVariableFilename.I.

References Filename::get_extension().

string ConfigVariableFilename::get_fullpath ( ) const [inline]

Returns the entire filename: directory, basename, extension.

This is the same thing returned by the string typecast operator, so this function is a little redundant.

Definition at line 118 of file configVariableFilename.I.

References Filename::get_fullpath().

string ConfigVariableFilename::get_fullpath_wo_extension ( ) const [inline]

Returns the full filename--directory and basename parts--except for the extension.

Definition at line 154 of file configVariableFilename.I.

References Filename::get_fullpath_wo_extension().

Filename ConfigVariableFilename::get_value ( ) const [inline]

Returns the variable's value.

Definition at line 229 of file configVariableFilename.I.

Filename ConfigVariableFilename::get_word ( int  n) const [inline]

Returns the variable's nth value.

Definition at line 257 of file configVariableFilename.I.

References ConfigVariable::get_string_word().

ConfigVariableFilename::operator const Filename & ( ) const [inline]

Returns the variable's value as a Filename.

Definition at line 64 of file configVariableFilename.I.

void ConfigVariableFilename::operator= ( const Filename value) [inline]

Reassigns the variable's local value.

Definition at line 54 of file configVariableFilename.I.

References set_value().

void ConfigVariableFilename::set_value ( const Filename value) [inline]

Reassigns the variable's local value.

Definition at line 219 of file configVariableFilename.I.

References ConfigVariable::set_string_value().

Referenced by operator=().

void ConfigVariableFilename::set_word ( int  n,
const Filename value 
) [inline]

Reassigns the variable's nth value.

This makes a local copy of the variable's overall value.

Definition at line 268 of file configVariableFilename.I.

References ConfigVariable::set_string_word().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations