aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-09-04 23:30:07 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-09-04 23:30:07 +0100
commit27d57d9ed2f2a24a86b91029638563cd8ccfabab (patch)
treecc8bd72c1be1741d3206735ca591bffac9c49d75
parentb5280212886a3a31703600c12608c5a5a8be5555 (diff)
downloadpaludis-27d57d9ed2f2a24a86b91029638563cd8ccfabab.tar.gz
paludis-27d57d9ed2f2a24a86b91029638563cd8ccfabab.tar.xz
Contents is not a MetadataKey
-rw-r--r--doc/api/cplusplus/examples/example_metadata_key.cc9
-rw-r--r--paludis/metadata_key.cc1
-rw-r--r--paludis/metadata_key.hh2
-rw-r--r--paludis/user_dep_spec.cc18
-rw-r--r--python/metadata_key.cc92
-rw-r--r--ruby/metadata_key.cc40
-rw-r--r--ruby/package_id_TEST.rb3
-rwxr-xr-xsrc/clients/cave/cmd_display_resolution.cc5
-rw-r--r--src/clients/cave/cmd_info.cc4
-rw-r--r--src/clients/cave/cmd_match.cc4
-rw-r--r--src/clients/cave/cmd_show.cc35
-rw-r--r--src/clients/cave/format_plain_metadata_key.cc5
12 files changed, 2 insertions, 216 deletions
diff --git a/doc/api/cplusplus/examples/example_metadata_key.cc b/doc/api/cplusplus/examples/example_metadata_key.cc
index 02f4b32..fffa6ea 100644
--- a/doc/api/cplusplus/examples/example_metadata_key.cc
+++ b/doc/api/cplusplus/examples/example_metadata_key.cc
@@ -100,15 +100,6 @@ namespace
cout << indent << left << setw(30) << " Value:" << " " << pretty_print_time(key.parse_value().seconds()) << endl;
}
- void visit(const MetadataValueKey<std::shared_ptr<const Contents> > &)
- {
- cout << indent << left << setw(30) << " Class:" << " " <<
- "MetadataValueKey<std::shared_ptr<const Contents> > " << endl;
- /* We won't display the contents of the contents key here, since
- * it involves creating another visitor. See \ref
- * example_contents.cc "example_contents.cc" for that. */
- }
-
void visit(const MetadataValueKey<std::shared_ptr<const Choices> > &)
{
cout << indent << left << setw(30) << " Class:" << " " <<
diff --git a/paludis/metadata_key.cc b/paludis/metadata_key.cc
index 299e54e..2f009e5 100644
--- a/paludis/metadata_key.cc
+++ b/paludis/metadata_key.cc
@@ -91,6 +91,5 @@ namespace paludis
template class MetadataValueKey<FSPath>;
template class MetadataValueKey<SlotName>;
template class MetadataValueKey<std::shared_ptr<const PackageID> >;
- template class MetadataValueKey<std::shared_ptr<const Contents> >;
template class MetadataValueKey<std::shared_ptr<const Choices> >;
}
diff --git a/paludis/metadata_key.hh b/paludis/metadata_key.hh
index 396edcb..ad77942 100644
--- a/paludis/metadata_key.hh
+++ b/paludis/metadata_key.hh
@@ -26,7 +26,6 @@
#include <paludis/name-fwd.hh>
#include <paludis/dep_spec-fwd.hh>
#include <paludis/spec_tree.hh>
-#include <paludis/contents-fwd.hh>
#include <paludis/repository-fwd.hh>
#include <paludis/metadata_key_holder.hh>
#include <paludis/choice-fwd.hh>
@@ -104,7 +103,6 @@ namespace paludis
MetadataValueKey<FSPath>,
MetadataValueKey<SlotName>,
MetadataValueKey<std::shared_ptr<const PackageID> >,
- MetadataValueKey<std::shared_ptr<const Contents> >,
MetadataValueKey<std::shared_ptr<const Choices> >,
MetadataTimeKey,
MetadataSectionKey
diff --git a/paludis/user_dep_spec.cc b/paludis/user_dep_spec.cc
index 7c336f6..6d84005 100644
--- a/paludis/user_dep_spec.cc
+++ b/paludis/user_dep_spec.cc
@@ -643,24 +643,6 @@ namespace
return false;
}
- bool visit(const MetadataValueKey<std::shared_ptr<const Contents> > & s) const
- {
- auto v(s.parse_value());
- switch (op)
- {
- case '=':
- return pattern == join(indirect_iterator(v->begin()), indirect_iterator(v->end()), " ",
- stringify_contents_entry);
- case '<':
- return indirect_iterator(v->end()) != std::find_if(
- indirect_iterator(v->begin()),
- indirect_iterator(v->end()),
- StringifyEqual(pattern));
- }
-
- return false;
- }
-
bool visit(const MetadataValueKey<std::shared_ptr<const PackageID> > & k) const
{
return pattern == stringify(*k.parse_value());
diff --git a/python/metadata_key.cc b/python/metadata_key.cc
index 4b36283..a41f1f6 100644
--- a/python/metadata_key.cc
+++ b/python/metadata_key.cc
@@ -75,11 +75,6 @@ class MetadataKeySptrToPythonVisitor
obj = bp::object(std::static_pointer_cast<const MetadataTimeKey>(_m_ptr));
}
- void visit(const MetadataValueKey<std::shared_ptr<const Contents> > & k)
- {
- obj = bp::object(std::static_pointer_cast<const MetadataValueKey<std::shared_ptr<const Contents> > >(_m_ptr));
- }
-
void visit(const MetadataValueKey<std::shared_ptr<const Choices> > & k)
{
obj = bp::object(std::static_pointer_cast<const MetadataValueKey<std::shared_ptr<const Choices> > >(_m_ptr));
@@ -428,52 +423,6 @@ struct MetadataTimeKeyWrapper :
}
};
-struct MetadataContentsKeyWrapper :
- MetadataValueKey<std::shared_ptr<const Contents> > ,
- bp::wrapper<MetadataValueKey<std::shared_ptr<const Contents> > >
-{
- virtual const std::shared_ptr<const Contents> parse_value() const
- PALUDIS_ATTRIBUTE((warn_unused_result))
- {
- Lock l(get_mutex());
-
- if (bp::override f = get_override("parse_value"))
- return f();
- else
- throw PythonMethodNotImplemented("MetadataContentsKey", "parse_value");
- }
-
- virtual const std::string raw_name() const
- {
- Lock l(get_mutex());
-
- if (bp::override f = get_override("raw_name"))
- return f();
- else
- throw PythonMethodNotImplemented("MetadataContentsKey", "raw_name");
- }
-
- virtual const std::string human_name() const
- {
- Lock l(get_mutex());
-
- if (bp::override f = get_override("human_name"))
- return f();
- else
- throw PythonMethodNotImplemented("MetadataContentsKey", "human_name");
- }
-
- virtual MetadataKeyType type() const
- {
- Lock l(get_mutex());
-
- if (bp::override f = get_override("type"))
- return f();
- else
- throw PythonMethodNotImplemented("MetadataContentsKey", "type");
- }
-};
-
struct MetadataChoicesKeyWrapper :
MetadataValueKey<std::shared_ptr<const Choices> > ,
bp::wrapper<MetadataValueKey<std::shared_ptr<const Choices> > >
@@ -1137,47 +1086,6 @@ void expose_metadata_key()
;
/**
- * MetadataContentsKey
- */
- bp::register_ptr_to_python<std::shared_ptr<const MetadataValueKey<std::shared_ptr<const Contents> > > >();
- bp::implicitly_convertible<std::shared_ptr<MetadataContentsKeyWrapper>,
- std::shared_ptr<MetadataKey> >();
- bp::class_<MetadataContentsKeyWrapper, std::shared_ptr<MetadataContentsKeyWrapper>,
- bp::bases<MetadataKey>, boost::noncopyable>
- (
- "MetadataContentsKey",
- "A MetadataContentsKey is a MetadataKey that holds a Contents heirarchy.\n\n"
-
- "This class can be subclassed in Python.",
- bp::init<>(
- "__init__()"
- )
- )
- .def("parse_value", bp::pure_virtual(&MetadataValueKey<std::shared_ptr<const Contents> > ::parse_value),
- "parse_value() -> Contents\n"
- "Fetch our value."
- )
-
- //Work around epydoc bug
- .def("raw_name", bp::pure_virtual(&MetadataKey::raw_name),
- "raw_name() -> string\n"
- "Fetch our raw name."
- )
-
- //Work around epydoc bug
- .def("human_name", bp::pure_virtual(&MetadataKey::human_name),
- "human_name() -> string\n"
- "Fetch our human name."
- )
-
- //Work around epydoc bug
- .def("type", bp::pure_virtual(&MetadataKey::type),
- "type() -> MetadataKeyType\n"
- "Fetch our key type."
- )
- ;
-
- /**
* MetadataChoicesKey
*/
bp::register_ptr_to_python<std::shared_ptr<const MetadataValueKey<std::shared_ptr<const Choices> > > >();
diff --git a/ruby/metadata_key.cc b/ruby/metadata_key.cc
index 3ae3097..b2bc740 100644
--- a/ruby/metadata_key.cc
+++ b/ruby/metadata_key.cc
@@ -40,7 +40,6 @@ namespace
static VALUE c_metadata_slot_key;
static VALUE c_metadata_size_key;
static VALUE c_metadata_time_key;
- static VALUE c_metadata_contents_key;
static VALUE c_metadata_choices_key;
static VALUE c_metadata_keyword_name_set_key;
static VALUE c_metadata_string_set_key;
@@ -139,12 +138,6 @@ namespace
new std::shared_ptr<const MetadataKey>(mm));
}
- void visit(const MetadataValueKey<std::shared_ptr<const Contents> > &)
- {
- value = Data_Wrap_Struct(c_metadata_contents_key, 0, &Common<std::shared_ptr<const MetadataKey> >::free,
- new std::shared_ptr<const MetadataKey>(mm));
- }
-
void visit(const MetadataValueKey<std::shared_ptr<const Choices> > &)
{
value = Data_Wrap_Struct(c_metadata_choices_key, 0, &Common<std::shared_ptr<const MetadataKey> >::free,
@@ -378,29 +371,6 @@ namespace
/*
* call-seq:
- * parse_value -> Contents
- *
- * Our Value.
- * */
- VALUE
- metadata_contents_key_value(VALUE self)
- {
- try
- {
- std::shared_ptr<const MetadataKey> * self_ptr;
- Data_Get_Struct(self, std::shared_ptr<const MetadataKey>, self_ptr);
- if (std::static_pointer_cast<const MetadataValueKey<std::shared_ptr<const Contents> > >(*self_ptr)->parse_value())
- return contents_to_value(std::static_pointer_cast<const MetadataValueKey<std::shared_ptr<const Contents> > >(*self_ptr)->parse_value());
- return Qnil;
- }
- catch (const std::exception & e)
- {
- exception_to_ruby_exception(e);
- }
- }
-
- /*
- * call-seq:
* parse_value -> Choices
*
* Our Value.
@@ -689,17 +659,9 @@ namespace
rb_define_method(c_metadata_time_key, "parse_value", RUBY_FUNC_CAST(&metadata_time_key_value), 0);
/*
- * Document-class: Paludis::MetadataContentsKey
- *
- * Metadata class for Contents.
- */
- c_metadata_contents_key = rb_define_class_under(paludis_module(), "MetadataContentsKey", c_metadata_key);
- rb_define_method(c_metadata_contents_key, "parse_value", RUBY_FUNC_CAST(&metadata_contents_key_value), 0);
-
- /*
* Document-class: Paludis::MetadataChoicesKey
*
- * Metadata class for Contents.
+ * Metadata class for Choices.
*/
c_metadata_choices_key = rb_define_class_under(paludis_module(), "MetadataChoicesKey", c_metadata_key);
rb_define_method(c_metadata_choices_key, "parse_value", RUBY_FUNC_CAST(&metadata_choices_key_value), 0);
diff --git a/ruby/package_id_TEST.rb b/ruby/package_id_TEST.rb
index cdd0c59..2ef7ab6 100644
--- a/ruby/package_id_TEST.rb
+++ b/ruby/package_id_TEST.rb
@@ -51,8 +51,7 @@ module Paludis
include TestStuff
def classes
- [MetadataStringKey, MetadataContentsKey, MetadataTimeKey, MetadataKeywordNameSetKey,
- MetadataStringSetKey]
+ [MetadataStringKey, MetadataTimeKey, MetadataKeywordNameSetKey, MetadataStringSetKey]
end
def all_classes
diff --git a/src/clients/cave/cmd_display_resolution.cc b/src/clients/cave/cmd_display_resolution.cc
index 0aa4f7a..04fece6 100755
--- a/src/clients/cave/cmd_display_resolution.cc
+++ b/src/clients/cave/cmd_display_resolution.cc
@@ -928,11 +928,6 @@ namespace
cout << fuc(fs_mask_by(), fv<'i'>(indent), fv<'k'>(k.human_name()), fv<'v'>(pretty_print_time(k.parse_value().seconds())));
}
- void visit(const MetadataValueKey<std::shared_ptr<const Contents> > & k)
- {
- cout << fuc(fs_mask_by_valueless(), fv<'i'>(indent), fv<'k'>(k.human_name()));
- }
-
void visit(const MetadataValueKey<FSPath> & k)
{
cout << fuc(fs_mask_by(), fv<'i'>(indent), fv<'k'>(k.human_name()), fv<'v'>(stringify(k.parse_value())));
diff --git a/src/clients/cave/cmd_info.cc b/src/clients/cave/cmd_info.cc
index 9401851..ad0e698 100644
--- a/src/clients/cave/cmd_info.cc
+++ b/src/clients/cave/cmd_info.cc
@@ -270,10 +270,6 @@ namespace
cout << fuc(fs_metadata(), fv<'h'>(k.human_name()), fv<'i'>(std::string(indent, ' ')), fv<'s'>(stringify(*k.parse_value())));
}
- void visit(const MetadataValueKey<std::shared_ptr<const Contents> > &)
- {
- }
-
void visit(const MetadataValueKey<std::shared_ptr<const Choices> > &)
{
}
diff --git a/src/clients/cave/cmd_match.cc b/src/clients/cave/cmd_match.cc
index d39d835..88b01ab 100644
--- a/src/clients/cave/cmd_match.cc
+++ b/src/clients/cave/cmd_match.cc
@@ -282,10 +282,6 @@ namespace
texts.push_back(stringify((*i)->name_with_prefix()));
}
- void visit(const MetadataValueKey<std::shared_ptr<const Contents> > &)
- {
- }
-
void visit(const MetadataTimeKey & k)
{
texts.push_back(stringify(k.parse_value().seconds()));
diff --git a/src/clients/cave/cmd_show.cc b/src/clients/cave/cmd_show.cc
index 22a2368..a78d9fb 100644
--- a/src/clients/cave/cmd_show.cc
+++ b/src/clients/cave/cmd_show.cc
@@ -745,41 +745,6 @@ namespace
);
}
- void visit(const MetadataValueKey<std::shared_ptr<const Contents> > & k)
- {
- auto v(k.parse_value());
- if (cmdline.a_complex_keys.specified() || important)
- {
- if (cmdline.a_flat.specified())
- {
- ContentsDisplayer d(0);
- std::for_each(indirect_iterator(v->begin()), indirect_iterator(v->end()), accept_visitor(d));
- out << fuc(
- (cmdline.a_raw_names.specified() ? fs_metadata_value_raw() : fs_metadata_value_human()),
- fv<'s'>(cmdline.a_raw_names.specified() ? k.raw_name() : k.human_name()),
- fv<'v'>(d.s.str()),
- fv<'i'>(std::string(indent, ' ')),
- fv<'b'>(important ? "true" : ""),
- fv<'p'>("")
- );
- }
- else
- {
- ContentsDisplayer d(indent);
- std::for_each(indirect_iterator(v->begin()), indirect_iterator(v->end()), accept_visitor(d));
- out << fuc(
- (cmdline.a_raw_names.specified() ? fs_metadata_value_raw() : fs_metadata_value_human()),
- fv<'s'>(cmdline.a_raw_names.specified() ? k.raw_name() : k.human_name()),
- fv<'v'>(""),
- fv<'i'>(std::string(indent, ' ')),
- fv<'b'>(important ? "true" : ""),
- fv<'p'>("")
- );
- out << d.s.str();
- }
- }
- }
-
void visit(const MetadataValueKey<std::shared_ptr<const Choices> > & k)
{
auto choices(k.parse_value());
diff --git a/src/clients/cave/format_plain_metadata_key.cc b/src/clients/cave/format_plain_metadata_key.cc
index 528c00c..a2699d6 100644
--- a/src/clients/cave/format_plain_metadata_key.cc
+++ b/src/clients/cave/format_plain_metadata_key.cc
@@ -45,11 +45,6 @@ namespace
s << k.parse_value().seconds();
}
- void visit(const MetadataValueKey<std::shared_ptr<const Contents> > &)
- {
- s << "<unprintable>";
- }
-
void visit(const MetadataValueKey<std::shared_ptr<const Choices> > &)
{
s << "<unprintable>";