Ubuntu TV Media Scanner
A centralized index for removable media content.
|
This class adds some utilities for property implementations. More...
#include <mediascanner/property.h>
Classes | |
class | Private |
Public Types | |
typedef ValueType | value_type |
![]() | |
enum | Boundary { Inclusive, Exclusive } |
Boundaries of a range query. More... | |
enum | MergeStrategy { MergeAppend, MergeReplace, MergePreserve } |
How to resolve merge conflicts for this property. More... | |
typedef boost::variant < boost::blank, bool, int32_t, uint64_t, double, Fraction, DateTime, String > | ValueBase |
typedef std::pair< Property, Property::Value > | BoundValue |
A property value bound to an actual property. More... | |
typedef std::map< Property, Value > | ValueMap |
Maps properties to their actual values. More... | |
typedef std::set< Property > | Set |
A set of distinct properties. More... | |
typedef std::function< bool(const Property &property)> | PropertyVisitor |
Functions of this kind are passed to the VisitAll() method. More... | |
typedef std::function< bool(GstDiscovererInfo *info, GstDiscovererStreamInfo *stream, ValueMap *item)> | StreamInfoFunction |
Functions of this kind are merge the discoverer's stream information. More... | |
Public Member Functions | |
BoundValue | bind_value (const ValueType &value) const |
![]() | |
Property () | |
Constructs an unidentified property. More... | |
Property (const Property &other) | |
Constructs a copy of the other property. More... | |
~Property () | |
String | field_name () const |
Name of the Lucene++ field. More... | |
const MetadataKey & | metadata_key () const |
Id of the Grilo metadata key. More... | |
Category | category () const |
Category of the property. More... | |
std::set< std::string > | origins () const |
Origins of this property. More... | |
bool | is_null () const |
Checks if the property is undefined (null). More... | |
bool | supports_full_text_search () const |
Checks if the property permits full text searches. More... | |
MergeStrategy | merge_strategy () const |
How to resolve merge conflicts for this property. More... | |
bool | MergeStreamInfo (GstDiscovererInfo *media, GstDiscovererStreamInfo *stream, ValueMap *properties) const |
Extracts property values from discoverer stream information. More... | |
LuceneFields | MakeFields (const Value &value) const |
Turns a property value into Lucene++ fields. More... | |
Value | TransformFields (const LuceneFields &fields) const |
Extracts property values of the Lucene++ fields. More... | |
Value | TransformSingleField (Lucene::FieldablePtr field) const |
Lucene::QueryPtr | MakeTermQuery (const Value &value) const |
Constructs a Lucene term query for this property and value. More... | |
Lucene::QueryPtr | MakeRangeQuery (const Value &lower_value, Boundary lower_boundary, const Value &upper_value, Boundary upper_boundary) const |
Constructs a Lucene term query for this property and value. More... | |
Lucene::QueryPtr | MakeRangeQuery (const Value &lower_value, const Value &upper_value) |
Constructs a Lucene term query for this property and value. More... | |
template<typename T > | |
bool | TransformTagValue (const GValue *input, Value *output) const |
Converts a tag value into a canonical property value. More... | |
bool | TransformGriloValue (const GValue *input, Value *output) const |
Converts a tag value into a canonical property value. More... | |
bool | TransformDBusVariant (GVariant *input, Value *output) const |
GValue * | MakeGriloValue (const Value &value) const |
Turns a property value into a Grilo value. More... | |
bool | operator== (const Property &other) const |
Checks if two properties are the same. More... | |
bool | operator!= (const Property &other) const |
Checks if two properties are the different. More... | |
operator const void * () const | |
Safe boolean cast. The more natural operator bool() is problematic because it leads to unwanted implicit casts. More... | |
bool | operator< (const Property &other) const |
Define sort order for usage in std::map. More... | |
Protected Types | |
typedef value_type(* | MediaInfoGetter )(const GstDiscovererInfo *) |
typedef value_type(* | StreamInfoGetter )(const GstDiscovererStreamInfo *) |
typedef value_type(* | AudioInfoGetter )(const GstDiscovererAudioInfo *) |
typedef value_type(* | VideoInfoGetter )(const GstDiscovererVideoInfo *) |
![]() | |
typedef std::shared_ptr< Private > | PrivatePtr |
Shared pointer to internal property fields. More... | |
Protected Member Functions | |
GenericProperty (Private *impl) | |
StreamInfoFunction | bind_attr (MediaInfoGetter get_attribute) |
StreamInfoFunction | bind_attr (StreamInfoGetter get_attribute) |
StreamInfoFunction | bind_attr (AudioInfoGetter get_attribute) |
StreamInfoFunction | bind_attr (VideoInfoGetter get_attribute) |
StreamInfoFunction | bind_tag (const char *tag_name) const |
![]() | |
Property (PrivatePtr impl) | |
Constructs a new property instance. More... | |
StreamInfoFunction | bind_any (const StreamInfoFunction &first, const StreamInfoFunction &second) const |
template<typename ValueType > | |
bool | MergeAttribute (GstDiscovererInfo *media, GstDiscovererStreamInfo *stream, ValueType(*get_attribute)(const GstDiscovererInfo *), ValueMap *item) const |
template<typename ValueType , typename InfoType > | |
bool | MergeAttribute (GstDiscovererInfo *media, GstDiscovererStreamInfo *stream, ValueType(*get_attribute)(const InfoType *), ValueMap *item) const |
template<typename ValueType > | |
bool | MergeTag (GstDiscovererInfo *media, GstDiscovererStreamInfo *stream, const char *tag_name, ValueMap *item) const |
template<typename ValueType > | |
StreamInfoFunction | bind_attr (ValueType(*)(const GstDiscovererInfo *)) |
template<typename ValueType , typename InfoType > | |
StreamInfoFunction | bind_attr (ValueType(*)(const InfoType *)) |
template<typename ValueType > | |
StreamInfoFunction | bind_tag (const char *tag_name) const |
Additional Inherited Members | |
![]() | |
static Property | FromFieldName (const String &name) |
Finds a property by its Lucene++ field name. More... | |
static Property | FromMetadataKey (GrlKeyID key) |
Finds a property by its Grilo metadata key. More... | |
static void | VisitAll (const PropertyVisitor &visit) |
Visits all property declarations known to the media scanner. More... | |
![]() | |
static MetadataKey | define_boolean (const char *name, const char *nick, const char *blurb, bool default_value) |
static MetadataKey | define_datetime (const char *name, const char *nick, const char *blurb) |
static MetadataKey | define_string (const char *name, const char *nick, const char *blurb, const char *default_value=0) |
static bool | merge_nothing (const GstDiscovererInfo *, const GstDiscovererStreamInfo *, ValueMap *) |
static bool | MergeAny (GstDiscovererInfo *media, GstDiscovererStreamInfo *stream, const StreamInfoFunction &merge_first, const StreamInfoFunction &merge_second, ValueMap *item) |
This class adds some utilities for property implementations.
|
protected |
|
protected |
|
protected |
typedef ValueType mediascanner::GenericProperty< PropertyType, ValueType >::value_type |
|
protected |
|
inlineexplicitprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inline |