00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef PALUDIS_GUARD_PALUDIS_SET_FILE_HH
00021 #define PALUDIS_GUARD_PALUDIS_SET_FILE_HH 1
00022
00023 #include <paludis/util/instantiation_policy.hh>
00024 #include <paludis/util/private_implementation_pattern.hh>
00025 #include <paludis/util/exception.hh>
00026 #include <paludis/util/fs_entry.hh>
00027 #include <paludis/util/options.hh>
00028 #include <paludis/util/named_value.hh>
00029 #include <paludis/name.hh>
00030 #include <paludis/spec_tree.hh>
00031 #include <paludis/dep_spec-fwd.hh>
00032 #include <paludis/dep_tag-fwd.hh>
00033 #include <tr1/functional>
00034 #include <iosfwd>
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 namespace paludis
00049 {
00050 class Environment;
00051
00052 #include <paludis/set_file-se.hh>
00053
00054 namespace n
00055 {
00056 struct environment;
00057 struct file_name;
00058 struct parser;
00059 struct set_operator_mode;
00060 struct tag;
00061 struct type;
00062 }
00063
00064
00065
00066
00067
00068
00069
00070 struct SetFileParams
00071 {
00072 NamedValue<n::environment, const Environment *> environment;
00073 NamedValue<n::file_name, FSEntry> file_name;
00074 NamedValue<n::parser, std::tr1::function<PackageDepSpec (const std::string &)> > parser;
00075 NamedValue<n::set_operator_mode, SetFileSetOperatorMode> set_operator_mode;
00076 NamedValue<n::tag, std::tr1::shared_ptr<const DepTag> > tag;
00077 NamedValue<n::type, SetFileType> type;
00078 };
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088 class PALUDIS_VISIBLE SetFileError :
00089 public ConfigurationError
00090 {
00091 public:
00092
00093
00094
00095 SetFileError(const FSEntry &, const std::string &) throw ();
00096
00097
00098 };
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115 class PALUDIS_VISIBLE SetFile :
00116 private InstantiationPolicy<SetFile, instantiation_method::NonCopyableTag>,
00117 private PrivateImplementationPattern<SetFile>
00118 {
00119 public:
00120
00121
00122
00123 SetFile(const SetFileParams &);
00124 ~SetFile();
00125
00126
00127
00128
00129
00130
00131 const std::tr1::shared_ptr<const SetSpecTree> contents() const;
00132
00133
00134
00135
00136 void rewrite() const;
00137
00138
00139
00140
00141 void add(const std::string &);
00142
00143
00144
00145
00146 void remove(const std::string &);
00147 };
00148
00149
00150
00151
00152
00153
00154
00155
00156 std::pair<SetName, SetFileSetOperatorMode> find_base_set_name_and_suffix_mode(const SetName &)
00157 PALUDIS_VISIBLE PALUDIS_ATTRIBUTE((warn_unused_result));
00158 }
00159
00160 #endif