Panda3D
Public Member Functions | Public Attributes | List of all members
ConfigVariableFilename Class Reference

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

Inheritance diagram for ConfigVariableFilename:
ConfigVariable ConfigVariableBase ConfigFlags

Public Member Functions

 __init__ (const ConfigVariableFilename)
 
 __init__ (str name)
 
 __init__ (str name, const Filename default_value, str description, int flags)
 
str cStr ()
 
bool empty ()
 
str getBasename ()
 Returns the basename part of the filename. More...
 
str getBasenameWoExtension ()
 Returns the basename part of the filename, without the file extension. More...
 
Filename getDefaultValue ()
 Returns the variable's default value. More...
 
str getDirname ()
 Returns the directory part of the filename. More...
 
str getExtension ()
 Returns the file extension. More...
 
str getFullpath ()
 Returns the entire filename: directory, basename, extension. More...
 
str getFullpathWoExtension ()
 Returns the full filename–directory and basename parts–except for the extension. More...
 
Filename getValue ()
 Returns the variable's value. More...
 
Filename getWord (int n)
 Returns the variable's nth value. More...
 
int length ()
 
bool operator != (const Filename other)
 
char operator [] (int n)
 
bool operator< (const Filename other)
 
ConfigVariableFilename operator= (const Filename value)
 
bool operator== (const Filename other)
 
 setValue (const Filename value)
 Reassigns the variable's local value. More...
 
 setWord (int n, const Filename value)
 Reassigns the variable's nth value. More...
 
- Public Member Functions inherited from ConfigVariable
 __init__ (const ConfigVariable)
 
 __init__ (str name)
 Use this constructor to make a ConfigVariable of an unspecified type. More...
 
 clearValue ()
 Removes the value assigned to this variable, and lets its original value (as read from the prc files) show through. More...
 
int getNumWords ()
 Returns the number of words in the variable's value. More...
 
str getStringValue ()
 Returns the toplevel value of the variable, formatted as a string. More...
 
 setStringValue (str value)
 Changes the value assigned to this variable. More...
 
- Public Member Functions inherited from ConfigVariableBase
bool clearLocalValue ()
 Removes the local value defined for this variable, and allows its value to be once again retrieved from the .prc files. More...
 
str getDescription ()
 Returns the brief description of this variable, if it has been defined. More...
 
int getFlags ()
 Returns the flags value as set by set_flags(). More...
 
str getName ()
 Returns the name of the variable. More...
 
int getTrustLevel ()
 Returns the minimum trust_level a prc file must demonstrate in order to redefine the value for this variable. More...
 
ConfigFlags::ValueType getValueType ()
 Returns the stated type of this variable. More...
 
bool hasLocalValue ()
 Returns true if this variable's value has been shadowed by a local assignment (as created via make_local_value()), or false otherwise. More...
 
bool hasValue ()
 Returns true if this variable has an explicit value, either from a prc file or locally set, or false if variable has its default value. More...
 
bool isClosed ()
 Returns true if the variable is not trusted by any prc file (and hence cannot be modified from its compiled-in default value), or false for the normal case, in which the variable can be modified by any prc file at or above its trust level (see get_trust_level()). More...
 
bool isDynamic ()
 Returns true if the variable was indicated as "dynamic" by its constructor, indicating that its name was dynamically generated, possibly from a large pool, and it should not be listed along with the other variables. More...
 
 output (Ostream out)
 
 write (Ostream out)
 
- Public Member Functions inherited from ConfigFlags
 __init__ ()
 
 __init__ (const ConfigFlags)
 

Public Attributes

Filename default_value
 Returns the variable's default value. More...
 
Filename value
 Returns the variable's value. More...
 
- Public Attributes inherited from ConfigVariableBase
bool closed
 Returns true if the variable is not trusted by any prc file (and hence cannot be modified from its compiled-in default value), or false for the normal case, in which the variable can be modified by any prc file at or above its trust level (see get_trust_level()). More...
 
const String description
 Returns the brief description of this variable, if it has been defined. More...
 
bool dynamic
 Returns true if the variable was indicated as "dynamic" by its constructor, indicating that its name was dynamically generated, possibly from a large pool, and it should not be listed along with the other variables. More...
 
const String name
 Returns the name of the variable. More...
 
int trust_level
 Returns the minimum trust_level a prc file must demonstrate in order to redefine the value for this variable. More...
 
ConfigFlags::ValueType value_type
 Returns the stated type of this variable. More...
 

Additional Inherited Members

- Public Types inherited from ConfigFlags
enum  ValueType {
  VT_undefined = 0, VT_list = 1, VT_string = 2, VT_filename = 3,
  VT_bool = 4, VT_int = 5, VT_double = 6, VT_enum = 7,
  VT_search_path = 8, VT_int64 = 9, VT_color = 10
}
 
enum  VariableFlags {
  F_trust_level_mask = 4095, F_open = 4096, F_closed = 8192, F_dynamic = 16384,
  F_dconfig = 32768
}
 

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.

Member Function Documentation

◆ __init__() [1/3]

__init__ ( const  ConfigVariableFilename)

◆ __init__() [2/3]

__init__ ( str  name)

◆ __init__() [3/3]

__init__ ( str  name,
const Filename  default_value,
str  description,
int  flags 
)

◆ cStr()

str cStr ( )

◆ empty()

bool empty ( )

◆ getBasename()

str getBasename ( )

Returns the basename part of the filename.

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

◆ getBasenameWoExtension()

str getBasenameWoExtension ( )

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

◆ getDefaultValue()

Filename getDefaultValue ( )

Returns the variable's default value.

◆ getDirname()

str getDirname ( )

Returns the directory part of the filename.

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

◆ getExtension()

str getExtension ( )

Returns the file extension.

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

◆ getFullpath()

str getFullpath ( )

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.

◆ getFullpathWoExtension()

str getFullpathWoExtension ( )

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

◆ getValue()

Filename getValue ( )

Returns the variable's value.

◆ getWord()

Filename getWord ( int  n)

Returns the variable's nth value.

◆ length()

int length ( )

◆ operator !=()

bool operator != ( const Filename  other)

◆ operator []()

char operator [] ( int  n)

◆ operator<()

bool operator< ( const Filename  other)

◆ operator=()

ConfigVariableFilename operator= ( const Filename  value)

◆ operator==()

bool operator== ( const Filename  other)

◆ setValue()

setValue ( const Filename  value)

Reassigns the variable's local value.

◆ setWord()

setWord ( int  n,
const Filename  value 
)

Reassigns the variable's nth value.

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

Member Data Documentation

◆ default_value

Filename default_value

Returns the variable's default value.

◆ value

Filename value

Returns the variable's value.