yast2-core
pathsearch.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | |
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
8 | |
9 | core system |
10 | (C) SuSE GmbH |
11 \----------------------------------------------------------------------/
12 
13  File: pathsearch.h
14 
15  Authors: Mathias Kettner <kettner@suse.de>
16  Arvin Schnell <arvin@suse.de>
17  Martin Vidner <mvidner@suse.cz>
18  Maintainer: Arvin Schnell <arvin@suse.de>
19 
20 /-*/
21 // -*- c++ -*-
22 
23 /*
24  * Search for YaST2 files at different paths.
25  */
26 
27 #include <stdio.h>
28 #include <fcntl.h>
29 
30 #include <string>
31 #include <list>
32 #include <vector>
33 
34 using std::string;
35 using std::vector;
36 
37 
39 {
40 
41 public:
42 
46  static int numberOfComponentLevels ();
47 
54 
59  static string searchPath (WHAT what, int level);
60 
65  static int currentComponentLevel ();
66 
72  static string findy2 (string filename, int mode = R_OK, int level = -1);
73 
84  static string findy2exe (string root, string compname, bool server,
85  bool non_y2, int level);
86 
91  static string findy2plugin (string name, int level);
92 
94  static string globsubst (const string& where,
95  const string& oldstr, const string& newstr);
100  static string completeFilename (const string& fname);
101 
102 protected:
103  static bool searchPrefixWarn;
104 
105  static vector<string> getPaths();
106 
107 private:
108  static int defaultComponentLevel ();
109 
110  static vector<string> paths;
111  static void initializePaths();
112 };
113 
120 {
121 public:
122  enum Kind
123  {
124  // would like to use all uppercase,
125  // but the parser tokens are the allmighty #defines...
129  // all others: scrconf, menuentry, plugin, agent... ?
130  num_Kind // last
131  };
132 
136  static string find (Kind kind, const string& name);
140  static string findInclude (const string& name);
141 
148  static string findModule (string name, bool the_source = false);
149 
155  static void addPath (Kind kind, const string& path);
156 
162  static void clearPaths (Kind kind);
163 
168  static void initialize ();
169 
171  static std::list<string>::const_iterator searchListBegin (Kind kind);
173  static std::list<string>::const_iterator searchListEnd (Kind kind);
174 
182  static string bytecodeForFile (string file);
183 
184 private:
185  static bool initialized;
186  static std::list<string> searchList[num_Kind];
187  static void initialize (Kind kind, const char *suffix);
188 };
static int defaultComponentLevel()
Definition: pathsearch.cc:227
Definition: pathsearch.h:127
This is a Modules Agent TODO file $Id path
Definition: agent-modules/doc/TODO.txt:9
Definition: pathsearch.h:38
Definition: pathsearch.h:126
enters the component to the broker s list in the given order Y2Component int int current_level same as but for external components which may reside in different directories The level identifies the directory prefix from the list defined in pathsearch cc bool false for clients bool true for clients Catalog of component take it if we can stat it and it is not take it if we can t stat it and its line matches in current level only name
Definition: componentcreator.txt:34
static vector< string > paths
Definition: pathsearch.h:110
static bool searchPrefixWarn
Definition: pathsearch.h:103
Definition: pathsearch.h:128
static string findy2exe(string root, string compname, bool server, bool non_y2, int level)
Definition: pathsearch.cc:174
static string findy2plugin(string name, int level)
Definition: pathsearch.cc:206
Kind
Definition: pathsearch.h:122
static string searchPath(WHAT what, int level)
Definition: pathsearch.cc:94
WHAT
Definition: pathsearch.h:53
static int numberOfComponentLevels()
Definition: pathsearch.cc:86
Definition: pathsearch.h:119
static vector< string > getPaths()
Definition: pathsearch.cc:42
enters the component to the broker s list in the given order Y2Component int level
Definition: componentcreator.txt:21
static void initializePaths()
Definition: pathsearch.cc:78
Definition: pathsearch.h:53
Definition: pathsearch.h:53
static string globsubst(const string &where, const string &oldstr, const string &newstr)
globsubst ("YaST::Foo::UI", "::", "/") == "YaST/Foo/UI"
Interface specification for modules and all text on a line after a Lines may be continued by ending the line with a The remaining lines should all conform to one of the following are used in the etc modules problems begin When we do not want to break the file
Definition: modules_conf.altern.txt:2
static string findy2(string filename, int mode=R_OK, int level=-1)
Definition: pathsearch.cc:143
static int currentComponentLevel()
Definition: pathsearch.cc:245
Definition: pathsearch.h:53
static string completeFilename(const string &fname)
Definition: pathsearch.cc:132
static bool initialized
Definition: pathsearch.h:185

Generated on a sunny day for yast2-core by doxygen 1.8.11