Panda3D
Classes | Public Member Functions | Static Public Member Functions | List of all members
DSearchPath Class Reference

This class stores a list of directories that can be searched, in order, to locate a particular file. It is normally constructed by passing it a traditional searchpath-style string, e.g. a list of directory names delimited by spaces or colons, but it can also be built up explicitly. More...

Classes

class  Results
 

Public Member Functions

 __init__ ()
 
 __init__ (const DSearchPath copy)
 
 __init__ (const Filename directory)
 
 __init__ (str path, str separator)
 
 appendDirectory (const Filename directory)
 
 appendPath (const DSearchPath path)
 
 appendPath (str path, str separator)
 
 clear ()
 
DSearchPath::Results findAllFiles (const Filename filename)
 This variant of find_all_files() returns the new Results object, instead of filling on in on the parameter list. This is a little more convenient to call from Python. More...
 
int findAllFiles (const Filename filename, DSearchPath::Results results)
 
Filename findFile (const Filename filename)
 
list getDirectories ()
 
const Filename getDirectory (int n)
 
int getNumDirectories ()
 
bool isEmpty ()
 
DSearchPath operator= (const DSearchPath copy)
 
 output (Ostream out, str separator)
 
 prependDirectory (const Filename directory)
 
 prependPath (const DSearchPath path)
 
 write (Ostream out, int indent_level)
 

Static Public Member Functions

static Filename searchPath (const Filename filename, str path, str separator)
 A quick-and-easy way to search a searchpath for a file when you don't feel like building or keeping around a DSearchPath object. This simply constructs a temporary DSearchPath based on the indicated path string, and searches that. More...
 

Detailed Description

This class stores a list of directories that can be searched, in order, to locate a particular file. It is normally constructed by passing it a traditional searchpath-style string, e.g. a list of directory names delimited by spaces or colons, but it can also be built up explicitly.

Member Function Documentation

◆ __init__() [1/4]

__init__ ( )

◆ __init__() [2/4]

__init__ ( const DSearchPath  copy)

◆ __init__() [3/4]

__init__ ( const Filename  directory)

◆ __init__() [4/4]

__init__ ( str  path,
str  separator 
)

◆ appendDirectory()

appendDirectory ( const Filename  directory)

◆ appendPath() [1/2]

appendPath ( const DSearchPath  path)

◆ appendPath() [2/2]

appendPath ( str  path,
str  separator 
)

◆ clear()

clear ( )

◆ findAllFiles() [1/2]

DSearchPath::Results findAllFiles ( const Filename  filename)

This variant of find_all_files() returns the new Results object, instead of filling on in on the parameter list. This is a little more convenient to call from Python.

◆ findAllFiles() [2/2]

int findAllFiles ( const Filename  filename,
DSearchPath::Results  results 
)

◆ findFile()

Filename findFile ( const Filename  filename)

◆ getDirectories()

list getDirectories ( )

◆ getDirectory()

const Filename getDirectory ( int  n)

◆ getNumDirectories()

int getNumDirectories ( )

◆ isEmpty()

bool isEmpty ( )

◆ operator=()

DSearchPath operator= ( const DSearchPath  copy)

◆ output()

output ( Ostream  out,
str  separator 
)

◆ prependDirectory()

prependDirectory ( const Filename  directory)

◆ prependPath()

prependPath ( const DSearchPath  path)

◆ searchPath()

static Filename searchPath ( const Filename  filename,
str  path,
str  separator 
)
static

A quick-and-easy way to search a searchpath for a file when you don't feel like building or keeping around a DSearchPath object. This simply constructs a temporary DSearchPath based on the indicated path string, and searches that.

◆ write()

write ( Ostream  out,
int  indent_level 
)