Ubuntu TV Media Scanner
A centralized index for removable media content.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Namespaces | Classes | Typedefs | Enumerations | Functions
mediascanner Namespace Reference

Public components of the Ubuntu TV Media Scanner. More...

Namespaces

 dbus
 
 schema
 Property definitions of the Ubuntu TV Media Scanner.
 

Classes

class  CommitPolicy
 A commit policy decides when changes to the media index are written back to the disk. More...
 
class  InstantCommitPolicy
 A CommitPolicy which askes for instant commit of any change. More...
 
class  DelayedCommitPolicy
 A CommitPolicy which delays commits slightly, trying to batch them. More...
 
class  MediaIndexFacade
 
class  Wrapper
 A shared smart-pointer for GLib related types. More...
 
class  FileSystemScanner
 
class  FileSystemWalker
 
class  Filter
 
class  QueryStringFilter
 
class  SubStringFilter
 
class  FullTextFilter
 
class  PrefixFilter
 
class  ValueFilter
 
class  RangeFilter
 
class  BooleanFilter
 
struct  ListWrapper
 
class  Source
 The Source class provides access to the GLib event source mechanism. More...
 
class  Idle
 The Idle class provides access to GLib's idle source mechanism. More...
 
class  Timeout
 The Timeout class provides access to GLib's timeout mechanism. More...
 
class  MediaArtCache
 
class  MediaArtDownloader
 
class  MediaIndex
 A read-only instance of the media index. More...
 
class  MediaRoot
 
class  MediaRootManager
 
class  MimeType
 
class  MediaInfo
 
class  MetadataResolver
 
class  Property
 Definition of a property value. More...
 
class  GenericProperty
 This class adds some utilities for property implementations. More...
 
class  DateTimeProperty
 
class  NumericProperty
 
class  GenericStringProperty
 
class  RefreshPolicy
 A refresh policy decides when changes to the media index must be re-read. More...
 
class  InstantRefreshPolicy
 
class  Settings
 
class  TaskManager
 The TaskManager schedules tasks for running them in a background thread. More...
 
struct  flag_operations
 
struct  flag_operations< void >
 
class  WritableMediaIndex
 A writable instance of the media index. More...
 

Typedefs

typedef std::shared_ptr
< CommitPolicy
CommitPolicyPtr
 
typedef std::shared_ptr
< MediaArtDownloader
MediaArtDownloaderPtr
 
typedef std::shared_ptr
< MediaRootManager
MediaRootManagerPtr
 
typedef std::shared_ptr
< MetadataResolver
MetadataResolverPtr
 
typedef std::shared_ptr
< TaskManager
TaskManagerPtr
 
typedef boost::filesystem::path FileSystemPath
 
typedef boost::rational< uint32_t > Fraction
 The relational data type we support. More...
 
typedef boost::posix_time::ptime DateTime
 The date-time type we support. More...
 
typedef std::wstring String
 The string type we support. More...
 
typedef GenericStringProperty
< DisableFullTextSearch
StringProperty
 
typedef GenericStringProperty
< EnableFullTextSearch
TextProperty
 
typedef std::shared_ptr
< RefreshPolicy
RefreshPolicyPtr
 Shared pointer holding a RefreshPolicy. More...
 

Enumerations

enum  FullTextSearchMode { DisableFullTextSearch, EnableFullTextSearch }
 

Functions

template<typename T >
T * shallow_copy (const T *p)
 A type-safe function for creating shallow copies of structures. More...
 
template<typename T , size_t N>
static T * array_copy (const T(&p)[N])
 A type-safe function for creating shallow copies of pointer arrays. More...
 
template<typename T >
Wrapper< T > wrap (T *p)
 Wraps a pointer to an object by a shared smart-pointer. More...
 
template<typename T >
Wrapper< T > take (T *p)
 Wraps a pointer to an object by a shared smart-pointer. More...
 
template<typename T >
Wrapper< T > wrap_static (const T *p)
 Wraps a statically allocated structure by a shared smart-pointer. More...
 
template<typename T >
void DestroyNotify (gpointer user_data)
 Type-safe destroy notifier. More...
 
template<typename T >
void ClosureNotify (gpointer user_data, GClosure *)
 
std::string to_string (const GError *error)
 Describes a GError. More...
 
std::string to_string (const GstCaps *caps)
 Describes GStreamer capabilities. More...
 
template<typename BoxedType >
GParamSpecMakeParamSpecBoxed (const char *name, const char *nick, const char *blurb, GParamFlags flags)
 Creates a GParamSpec for boxed types. More...
 
bool CheckLocaleFacets (const std::locale &loc=std::locale())
 
std::locale SetupLocale (const std::string &id=std::string())
 
std::locale SetupLocale (const std::locale &base, const std::string &id)
 
std::wstring ToUnicode (const std::string &str, const std::locale &loc=std::locale())
 
std::string FromUnicode (const std::wstring &str, const std::locale &loc=std::locale())
 
template<typename T >
operator| (T a, T b)
 
template<typename T >
operator& (T a, T b)
 
template<typename T >
operator~ (T a)
 
void abort_with_backtrace ()
 abort_with_backtrace Prints a backtrace and aborts then. More...
 
std::string safe_string (const char *str)
 Safely constructs a std::string from potential null pointers. More...
 
std::string take_string (char *str)
 Safely constructs a std::string from potential null pointers and then frees the pointer. More...
 
std::wstring safe_wstring (const char *str)
 Safely constructs a std::wstring from potential null pointers. More...
 
template<typename KeyType , typename ValueType >
std::map< KeyType, ValueType > & operator<< (std::map< KeyType, ValueType > &target, const typename std::map< KeyType, ValueType >::value_type &element)
 Conveniently fills the std::map target with elements. More...
 
template<typename T >
std::vector< T > & operator<< (std::vector< T > &target, const T &element)
 Conveniently fills the std::vector target with elements. More...
 
template<typename T >
std::vector< T > operator<< (const std::vector< T > &source, const T &element)
 Conveniently creates a copy of the std::vector source, and then pushes element to its end. More...
 
std::ostream & operator<< (std::ostream &os, const class Property &p)
 Prints a property to a regular I/O stream. More...
 

Detailed Description

Public components of the Ubuntu TV Media Scanner.

Typedef Documentation

typedef boost::posix_time::ptime mediascanner::DateTime

The date-time type we support.

typedef boost::filesystem::path mediascanner::FileSystemPath
typedef boost::rational<uint32_t> mediascanner::Fraction

The relational data type we support.

Fractions are used for instance to preciscely describe a photo's exposure time.

Shared pointer holding a RefreshPolicy.

typedef std::wstring mediascanner::String

The string type we support.

We use std::wstring instead of std::string to match Lucene++.

Enumeration Type Documentation

Enumerator
DisableFullTextSearch 
EnableFullTextSearch 

Function Documentation

void mediascanner::abort_with_backtrace ( )

abort_with_backtrace Prints a backtrace and aborts then.

Useful for std::set_terminate().

template<typename T , size_t N>
static T* mediascanner::array_copy ( const T(&)  p[N])
static

A type-safe function for creating shallow copies of pointer arrays.

Parameters
TThe array's element type.
NThe number of elements in the array.
pA pointer to the array to copy.
Returns
A new copy of the array, as returned by g_memdup().
bool mediascanner::CheckLocaleFacets ( const std::locale &  loc = std::locale())
template<typename T >
void mediascanner::ClosureNotify ( gpointer  user_data,
GClosure *   
)
inline
template<typename T >
void mediascanner::DestroyNotify ( gpointer  user_data)
inline

Type-safe destroy notifier.

This function can be used as destroy notifier for GLib functions. It automatically invokes the proper delete operator of T.

Parameters
TThe type of the object to destroy.
user_dataA pointer to the object to destroy.
std::string mediascanner::FromUnicode ( const std::wstring &  str,
const std::locale &  loc = std::locale() 
)
inline
template<typename BoxedType >
GParamSpec* mediascanner::MakeParamSpecBoxed ( const char *  name,
const char *  nick,
const char *  blurb,
GParamFlags  flags 
)
inline

Creates a GParamSpec for boxed types.

This function is useful in static variable initialization to defer G_TYPE_* calls that could lead to warnings about the missing g_type_init() invocation.

Parameters
BoxedTypeG_TYPE_BOXED derived type of this property.
nameCanonical name of the property specified.
nickNick name for the property specified.
blurbDescription of the property specified.
flagsFlags for the property specified.
Returns
A newly created parameter specification.
template<typename T >
T mediascanner::operator& ( a,
b 
)
inline
template<typename KeyType , typename ValueType >
std::map<KeyType, ValueType>& mediascanner::operator<< ( std::map< KeyType, ValueType > &  target,
const typename std::map< KeyType, ValueType >::value_type &  element 
)
inline

Conveniently fills the std::map target with elements.

Parameters
targetThe map to fill.
elementThe element to fill in.
Returns
map
template<typename T >
std::vector<T>& mediascanner::operator<< ( std::vector< T > &  target,
const T &  element 
)
inline

Conveniently fills the std::vector target with elements.

Parameters
vectorThe vector to fill.
elementThe element to fill in.
Returns
vec
template<typename T >
std::vector<T> mediascanner::operator<< ( const std::vector< T > &  source,
const T &  element 
)
inline

Conveniently creates a copy of the std::vector source, and then pushes element to its end.

Parameters
sourceThe vector to fill.
elementThe element to fill in.
Returns
A new vector
std::ostream& mediascanner::operator<< ( std::ostream &  os,
const class Property &  p 
)

Prints a property to a regular I/O stream.

This is useful in the context of boost::locale::format and logging.

Parameters
osThe target stream
sThe property to print
Returns
os logging
template<typename T >
T mediascanner::operator| ( a,
b 
)
inline
template<typename T >
T mediascanner::operator~ ( a)
inline
std::string mediascanner::safe_string ( const char *  str)
inline

Safely constructs a std::string from potential null pointers.

Parameters
strA nul terminated string, or null.
Returns
A new std::string instance.
std::wstring mediascanner::safe_wstring ( const char *  str)

Safely constructs a std::wstring from potential null pointers.

Parameters
strA nul terminated string, or null.
Returns
A new std::wstring instance.
std::locale mediascanner::SetupLocale ( const std::string &  id = std::string())
std::locale mediascanner::SetupLocale ( const std::locale &  base,
const std::string &  id 
)
template<typename T >
T* mediascanner::shallow_copy ( const T *  p)
inline

A type-safe function for creating shallow copies of structures.

Parameters
TThe structure's type.
pA pointer to the structure to copy.
Returns
A new copy of the structure, as returned by g_memdup().
template<typename T >
Wrapper<T> mediascanner::take ( T *  p)
inline

Wraps a pointer to an object by a shared smart-pointer.

This function takes ownership of the object. It therefore doesn't increase the object's reference count.

Parameters
TThe type of the object to wrap.
pThe pointer to the object to wrap.
Returns
A new Wrapper instance that holds now owns the object.
std::string mediascanner::take_string ( char *  str)
inline

Safely constructs a std::string from potential null pointers and then frees the pointer.

Parameters
strA nul terminated string, or null.
Returns
A new std::string instance.
std::string mediascanner::to_string ( const GError error)

Describes a GError.

The returned string contains the error domain, the error code, and of course the error message.

Parameters
errorThe error to describe, or null
Returns
A description of the error if appliable.
std::string mediascanner::to_string ( const GstCaps *  caps)

Describes GStreamer capabilities.

Parameters
capsThe capabilities to describe, or null
Returns
A describption of the capabilities if appliable
std::wstring mediascanner::ToUnicode ( const std::string &  str,
const std::locale &  loc = std::locale() 
)
inline
template<typename T >
Wrapper<T> mediascanner::wrap ( T *  p)
inline

Wraps a pointer to an object by a shared smart-pointer.

This function doesn't take ownership of the object. It therefore does increase the object's reference count.

Parameters
TThe type of the object to wrap.
pThe pointer to the object to wrap.
Returns
A new Wrapper instance that holds a new reference to the object.
template<typename T >
Wrapper<T> mediascanner::wrap_static ( const T *  p)
inline

Wraps a statically allocated structure by a shared smart-pointer.

This function creates a shallow copy of the structure and then takes ownership of that copy.

Parameters
TThe type of the structure to wrap.
pThe pointer to the structure to wrap.
Returns
A new Wrapper instance that holds owns a copy of the structure.