#include <pathsearch.h>
Public Types | |
enum | WHAT { GENERIC, EXECCOMP, PLUGIN } |
Static Public Member Functions | |
static int | numberOfComponentLevels () |
static string | searchPath (WHAT what, int level) |
static int | currentComponentLevel () |
static string | findy2 (string filename, int mode=R_OK, int level=-1) |
static string | findy2exe (string root, string compname, bool server, bool non_y2, int level) |
static string | findy2plugin (string name, int level) |
static string | globsubst (const string &where, const string &oldstr, const string &newstr) |
globsubst ("YaST::Foo::UI", "::", "/") == "YaST/Foo/UI" | |
static string | completeFilename (const string &fname) |
Static Protected Member Functions | |
static vector< string > | getPaths () |
Static Protected Attributes | |
static bool | searchPrefixWarn = true |
Static Private Member Functions | |
static int | defaultComponentLevel () |
static void | initializePaths () |
Static Private Attributes | |
static vector< string > | paths |
enum Y2PathSearch::WHAT |
string Y2PathSearch::completeFilename | ( | const string & | fname | ) | [static] |
Complete filename to start with "/". Will take the current working directory into account.
References globsubst().
Referenced by Y2CCWFM::createInLevel(), YCPPathSearch::find(), and findy2().
int Y2PathSearch::currentComponentLevel | ( | ) | [static] |
Determines the current component level by consulting the environment variable Y2LEVEL
References defaultComponentLevel().
Referenced by Y2ComponentBroker::createComponent().
int Y2PathSearch::defaultComponentLevel | ( | ) | [static, private] |
References GENERIC, initializePaths(), paths, and searchPath().
Referenced by currentComponentLevel().
string Y2PathSearch::findy2 | ( | string | filename, | |
int | mode = R_OK , |
|||
int | level = -1 | |||
) | [static] |
Find the given file sequentially searched in the all search paths or only in the one specified by level. Return complete path on success or empty string on failure.
References completeFilename(), GENERIC, initializePaths(), paths, searchPath(), searchPrefixWarn, and y2warning.
Referenced by Y2CCWFM::createInLevel().
string Y2PathSearch::findy2exe | ( | string | root, | |
string | compname, | |||
bool | server, | |||
bool | non_y2, | |||
int | level | |||
) | [static] |
Searchs in one of a list of paths for a yast2 executable. Give the name compname relative to YAST2DIR. The flag server specifies, whether a server or a client component should be searched for. The flag non_y2 specifies, whether a ycp program or a non ycp program like a shell script should be searched for. Returns an empty string if no such component was found. Otherwise returns a complete absolute path. The level argument gives the number of the path to search in. Use numberOfComponentLevels () to get the number of allowed paths.
References EXECCOMP, searchPath(), and y2debug.
Referenced by Y2CCProgram::createInLevel().
string Y2PathSearch::findy2plugin | ( | string | name, | |
int | level | |||
) | [static] |
Search for a plugin in the specified level. On success return the absolute filename of the plugin, otherwise a empty string.
References PLUGIN, searchPath(), and y2debug.
Referenced by Y2CCPlugin::createInLevel(), and Y2CCPlugin::provideNamespace().
vector< string > Y2PathSearch::getPaths | ( | ) | [static, protected] |
References stringutil::join(), stringutil::split(), and y2debug.
Referenced by YCPPathSearch::initialize(), and initializePaths().
string Y2PathSearch::globsubst | ( | const string & | where, | |
const string & | oldstr, | |||
const string & | newstr | |||
) | [static] |
globsubst ("YaST::Foo::UI", "::", "/") == "YaST/Foo/UI"
Referenced by completeFilename().
void Y2PathSearch::initializePaths | ( | ) | [static, private] |
References getPaths(), and paths.
Referenced by defaultComponentLevel(), findy2(), numberOfComponentLevels(), and searchPath().
int Y2PathSearch::numberOfComponentLevels | ( | ) | [static] |
Returns the number of search paths.
References initializePaths(), and paths.
Referenced by Y2ComponentBroker::createComponent(), ScriptingAgent::InitRegDirs(), Y2CCPlugin::provideNamespace(), ScriptingAgent::Sweep(), and Y2LanguageLoader::Y2LanguageLoader().
string Y2PathSearch::searchPath | ( | WHAT | what, | |
int | level | |||
) | [static] |
Returns the n-th searchpath (starting at 0). No range check is performed.
References EXECCOMP, initializePaths(), paths, and PLUGIN.
Referenced by Y2ComponentBroker::createComponent(), defaultComponentLevel(), findy2(), findy2exe(), findy2plugin(), ScriptingAgent::InitRegDirs(), ScriptingAgent::Sweep(), and Y2LanguageLoader::Y2LanguageLoader().
vector< string > Y2PathSearch::paths [static, private] |
Referenced by defaultComponentLevel(), findy2(), YCPPathSearch::initialize(), initializePaths(), numberOfComponentLevels(), and searchPath().
bool Y2PathSearch::searchPrefixWarn = true [static, protected] |
Referenced by YCPPathSearch::find(), findy2(), and YCPPathSearch::initialize().