[rygel] core: No need for SearchCriteria class
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [rygel] core: No need for SearchCriteria class
- Date: Mon, 9 Nov 2009 18:45:10 +0000 (UTC)
commit dc773e530e17c90295991ef5779cf81f5dbbf777
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Tue Nov 3 16:23:10 2009 +0200
core: No need for SearchCriteria class
In the end, all we need is the search expression tree.
src/rygel/Makefile.am | 2 +-
src/rygel/rygel-search-criteria-parser.vala | 2 +-
...-criteria.vala => rygel-search-expression.vala} | 31 +++++--------------
3 files changed, 10 insertions(+), 25 deletions(-)
---
diff --git a/src/rygel/Makefile.am b/src/rygel/Makefile.am
index c78e5ac..e857cca 100644
--- a/src/rygel/Makefile.am
+++ b/src/rygel/Makefile.am
@@ -72,7 +72,7 @@ VAPI_SOURCE_FILES = rygel-configuration.vala \
rygel-thumbnailer.vala \
rygel-browse.vala \
rygel-search.vala \
- rygel-search-criteria.vala \
+ rygel-search-expression.vala \
rygel-search-criteria-parser.vala \
rygel-didl-lite-writer.vala \
rygel-transcoder.vala \
diff --git a/src/rygel/rygel-search-criteria-parser.vala b/src/rygel/rygel-search-criteria-parser.vala
index bc39342..d4accb1 100644
--- a/src/rygel/rygel-search-criteria-parser.vala
+++ b/src/rygel/rygel-search-criteria-parser.vala
@@ -25,7 +25,7 @@ using GUPnP;
using Gee;
/**
- * Parses a search criteria string and creates SearchCriteria as a result.
+ * Parses a search criteria string and creates SearchExpression as a result.
*/
internal class Rygel.SearchCriteriaParser : Object, StateMachine {
// The original string representation received from client
diff --git a/src/rygel/rygel-search-criteria.vala b/src/rygel/rygel-search-expression.vala
similarity index 76%
rename from src/rygel/rygel-search-criteria.vala
rename to src/rygel/rygel-search-expression.vala
index bb73809..e57cd35 100644
--- a/src/rygel/rygel-search-criteria.vala
+++ b/src/rygel/rygel-search-expression.vala
@@ -1,6 +1,5 @@
/*
- * Copyright (C) 2008 Nokia Corporation.
- * Copyright (C) 2008 Zeeshan Ali (Khattak) <zeeshanak gnome org>.
+ * Copyright (C) 2009 Nokia Corporation.
*
* Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
*
@@ -23,37 +22,23 @@
using GUPnP;
-/**
- * Represents SearchCriteria string in Search action of ContentDirectory.
- */
-public class Rygel.SearchCriteria : GLib.Object {
- // The original string representation received from client
- public string str;
-
- public SearchExpression expression; // The root expression
-
- internal SearchCriteria (string str,
- SearchExpression expression)
- throws Error {
- this.str = str;
- this.expression = expression;
- }
-
- public bool fullfills (MediaObject media_object) {
- return true;
- }
-}
-
public enum Rygel.LogicalOperator {
AND,
OR
}
+/**
+ * Represents a SearchExpression tree.
+ */
public class Rygel.SearchExpression<G,H,I> {
public G op; // Operator
public H operand1;
public I operand2;
+
+ public bool fullfills (MediaObject media_object) {
+ return true;
+ }
}
public class Rygel.AtomicExpression :
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]