Panda3D

Loading...
Searching...
No Matches
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...

`#include "configVariableFilename.h"`

Inheritance diagram for ConfigVariableFilename:

## Public Member Functions
| ConfigVariableFilename (const std::string &name)
| ConfigVariableFilename (const std::string &name, const Filename &default_value, const std::string &description=std::string(), int flags=0)
std::wstring | __fspath__ () const
| Allows a ConfigVariableFilename object to be passed to any Python function that accepts an os.PathLike object.
const char * | c_str () const
bool | empty () const
std::string | get_basename () const
| Returns the basename part of the filename.
std::string | get_basename_wo_extension () const
| Returns the basename part of the filename, without the file extension.
Filename | get_default_value () const
std::string | get_dirname () const
| Returns the directory part of the filename.
std::string | get_extension () const
| Returns the file extension.
std::string | get_fullpath () const
| Returns the entire filename: directory, basename, extension.
std::string | get_fullpath_wo_extension () const
| Returns the full filename–directory and basename parts–except for the extension.
Filename | get_value () const
Filename | get_word (size_t 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[] (size_t n) const
void | set_value (const Filename &value)
void | set_word (size_t n, const Filename &value)
| Reassigns the variable's nth value.
Public Member Functions inherited from ConfigVariable
| ConfigVariable (const std::string &name)
| Use this constructor to make a ConfigVariable of an unspecified type.
void | clear_value ()
| Removes the value assigned to this variable, and lets its original value (as read from the prc files) show through.
size_t | get_num_words () const
| Returns the number of words in the variable's value.
const std::string & | get_string_value () const
| Returns the toplevel value of the variable, formatted as a string.
void | set_string_value (const std::string &value)
| Changes the value assigned to this variable.
Public Member Functions inherited from ConfigVariableBase
bool | clear_local_value ()
| Removes the local value defined for this variable, and allows its value to be once again retrieved from the .prc files.
const std::string & | get_description () const
int | get_flags () const
| Returns the flags value as set by set_flags().
const std::string & | get_name () const
int | get_trust_level () const
ValueType | get_value_type () const
bool | has_local_value () const
| Returns true if this variable's value has been shadowed by a local assignment (as created via make_local_value()), or false otherwise.
bool | has_value () const
| 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.
bool | is_closed () const
bool | is_dynamic () const
void | output (std::ostream &out) const
void | write (std::ostream &out) const

## Public Attributes
| get_default_value
| Returns the variable's default value.
| get_value
| Returns the variable's value.
| set_value
| Reassigns the variable's local value.
Public Attributes inherited from ConfigVariableBase
| get_description
| Returns the brief description of this variable, if it has been defined.
| get_name
| Returns the name of the variable.
| get_trust_level
| Returns the minimum trust_level a prc file must demonstrate in order to redefine the value for this variable.
| get_value_type
| Returns the stated type of this variable.
| is_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()).
| is_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.

## Additional Inherited Members
Public Types inherited from ConfigFlags
enum | ValueType { VT_undefined , VT_list , VT_string , VT_filename , VT_bool , VT_int , VT_double , VT_enum , VT_search_path , VT_int64 , VT_color }
enum | VariableFlags { F_trust_level_mask = 0x00000fff , F_open = 0x00001000 , F_closed = 0x00002000 , F_dynamic = 0x00004000 , F_dconfig = 0x00008000 }

## 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 27 of file configVariableFilename.h.

## Constructor & Destructor Documentation

## ◆ ConfigVariableFilename() [1/2]

ConfigVariableFilename::ConfigVariableFilename | ( | const std::string & | name | ) |
| inline

Definition at line 17 of file configVariableFilename.I.

## ◆ ConfigVariableFilename() [2/2]

ConfigVariableFilename::ConfigVariableFilename | ( | const std::string & | name,
|  | const Filename & | default_value,
|  | const std::string & | description = std::string(),
|  | int | flags = 0 )
| inline

Definition at line 28 of file configVariableFilename.I.

## Member Function Documentation

## ◆ __fspath__()

std::wstring ConfigVariableFilename::__fspath__ | ( |  | ) | const
| inline

Allows a ConfigVariableFilename object to be passed to any Python function that accepts an os.PathLike object.

Since
  1.10.13

Definition at line 227 of file configVariableFilename.I.

## ◆ c_str()

const char * ConfigVariableFilename::c_str | ( |  | ) | const
| inline

Definition at line 61 of file configVariableFilename.I.

## ◆ empty()

bool ConfigVariableFilename::empty | ( |  | ) | const
| inline

Definition at line 69 of file configVariableFilename.I.

## ◆ get_basename()

std::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 114 of file configVariableFilename.I.

## ◆ get_basename_wo_extension()

std::string ConfigVariableFilename::get_basename_wo_extension | ( |  | ) | const
| inline

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

Definition at line 133 of file configVariableFilename.I.

## ◆ get_dirname()

std::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 105 of file configVariableFilename.I.

## ◆ get_extension()

std::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 143 of file configVariableFilename.I.

## ◆ get_fullpath()

std::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 96 of file configVariableFilename.I.

## ◆ get_fullpath_wo_extension()

std::string ConfigVariableFilename::get_fullpath_wo_extension | ( |  | ) | const
| inline

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

Definition at line 124 of file configVariableFilename.I.

## ◆ get_word()

Filename ConfigVariableFilename::get_word | ( | size_t | n | ) | const
| inline

Returns the variable's nth value.

Definition at line 207 of file configVariableFilename.I.

## ◆ length()

size_t ConfigVariableFilename::length | ( |  | ) | const
| inline

Definition at line 77 of file configVariableFilename.I.

## ◆ operator const Filename &()

ConfigVariableFilename::operator const Filename & | ( |  | ) | const
| inline

Returns the variable's value as a Filename.

Definition at line 53 of file configVariableFilename.I.

## ◆ operator!=()

bool ConfigVariableFilename::operator!= | ( | const Filename & | other | ) | const
| inline

Definition at line 159 of file configVariableFilename.I.

## ◆ operator<()

bool ConfigVariableFilename::operator< | ( | const Filename & | other | ) | const
| inline

Definition at line 167 of file configVariableFilename.I.

## ◆ operator=()

void ConfigVariableFilename::operator= | ( | const Filename & | value | ) |
| inline

Reassigns the variable's local value.

Definition at line 45 of file configVariableFilename.I.

References set_value.

## ◆ operator==()

bool ConfigVariableFilename::operator== | ( | const Filename & | other | ) | const
| inline

Definition at line 151 of file configVariableFilename.I.

## ◆ operator[]()

char ConfigVariableFilename::operator[] | ( | size_t | n | ) | const
| inline

Definition at line 85 of file configVariableFilename.I.

## ◆ set_word()

void ConfigVariableFilename::set_word | ( | size_t | 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 216 of file configVariableFilename.I.

## Member Data Documentation

## ◆ get_default_value

Filename ConfigVariableFilename::get_default_value
| inline

Returns the variable's default value.

Definition at line 58 of file configVariableFilename.h.

## ◆ get_value

Filename ConfigVariableFilename::get_value
| inline

Returns the variable's value.

Definition at line 57 of file configVariableFilename.h.

Referenced by Notify::config_initialized().

## ◆ set_value

void ConfigVariableFilename::set_value
| inline

Reassigns the variable's local value.

Definition at line 57 of file configVariableFilename.h.

Referenced by operator=().

The documentation for this class was generated from the following files:

- dtool/src/prc/configVariableFilename.h
- dtool/src/prc/configVariableFilename.cxx
- dtool/src/prc/configVariableFilename.I