00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef CONFIGVARIABLESEARCHPATH_H
00016 #define CONFIGVARIABLESEARCHPATH_H
00017
00018 #include "dtoolbase.h"
00019 #include "configVariableBase.h"
00020 #include "dSearchPath.h"
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 class EXPCL_DTOOLCONFIG ConfigVariableSearchPath : public ConfigVariableBase {
00043 PUBLISHED:
00044 INLINE ConfigVariableSearchPath(const string &name,
00045 const string &description = string(),
00046 int flags = 0);
00047 INLINE ConfigVariableSearchPath(const string &name,
00048 const DSearchPath &default_value,
00049 const string &description,
00050 int flags = 0);
00051 INLINE ConfigVariableSearchPath(const string &name,
00052 const string &default_value,
00053 const string &description,
00054 int flags = 0);
00055 INLINE ~ConfigVariableSearchPath();
00056
00057 INLINE operator const DSearchPath & () const;
00058 INLINE const DSearchPath &get_value() const;
00059 INLINE const DSearchPath &get_default_value() const;
00060
00061 INLINE bool clear_local_value();
00062
00063 INLINE void clear();
00064 INLINE void append_directory(const Filename &directory);
00065 INLINE void prepend_directory(const Filename &directory);
00066 INLINE void append_path(const string &path,
00067 const string &separator = string());
00068 INLINE void append_path(const DSearchPath &path);
00069 INLINE void prepend_path(const DSearchPath &path);
00070
00071 INLINE bool is_empty() const;
00072 INLINE int get_num_directories() const;
00073 INLINE const Filename &get_directory(int n) const;
00074 MAKE_SEQ(get_directories, get_num_directories, get_directory);
00075
00076 INLINE Filename find_file(const Filename &filename) const;
00077 INLINE int find_all_files(const Filename &filename,
00078 DSearchPath::Results &results) const;
00079 INLINE DSearchPath::Results find_all_files(const Filename &filename) const;
00080
00081 INLINE void output(ostream &out) const;
00082 INLINE void write(ostream &out) const;
00083
00084 private:
00085 void reload_search_path();
00086
00087 DSearchPath _default_value;
00088 DSearchPath _prefix, _postfix;
00089
00090 AtomicAdjust::Integer _local_modified;
00091 DSearchPath _cache;
00092 };
00093
00094 INLINE ostream &operator << (ostream &out, const ConfigVariableSearchPath &variable);
00095
00096 #include "configVariableSearchPath.I"
00097
00098 #endif