Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Alain Takoudjou
jio
Commits
e41abff9
Commit
e41abff9
authored
May 31, 2013
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP: complexquery.js
parent
848a655e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
3 deletions
+40
-3
src/queries/complexquery.js
src/queries/complexquery.js
+40
-3
No files found.
src/queries/complexquery.js
View file @
e41abff9
// XXX
// XXX
var
ComplexQuery
=
newClass
(
Query
,
function
()
{
var
ComplexQuery
=
newClass
(
Query
,
function
(
spec
)
{
/**
* Logical operator to use to compare object values
*
* @property operator
* @type String
* @default "AND"
*/
this
.
operator
=
spec
.
operator
||
"
AND
"
;
this
.
query_list
=
todo
;
/**
/**
* Filter the item list only if all the sub queries match this item according
* Filter the item list only if all the sub queries match this item according
* to the logical operator.
* to the logical operator.
* See {{#crossLink "Query/exec:method"}}{{/crossLink}}
* See {{#crossLink "Query/exec:method"}}{{/crossLink}}
*/
*/
this
.
exec
=
function
()
{
this
.
exec
=
function
(
item_list
,
option
)
{
todo
todo
};
};
// XXX
this
[
"
AND
"
]
=
function
(
item
,
wildcard_character
)
{
var
i
;
for
(
i
=
0
;
i
<
this
.
query_list
.
length
;
i
+=
1
)
{
if
(
!
this
.
query_list
[
i
].
match
(
item
,
wildcard_character
))
{
return
false
;
}
}
return
true
;
};
// XXX
this
[
"
OR
"
]
=
function
(
item
,
wildcard_character
)
{
var
i
;
for
(
i
=
0
;
i
<
this
.
query_list
.
length
;
i
+=
1
)
{
if
(
this
.
query_list
[
i
].
match
(
item
,
wildcard_character
))
{
return
true
;
}
}
return
false
;
};
// XXX
this
[
"
NOT
"
]
=
function
(
item
,
wildcard_character
)
{
return
!
this
.
query_list
[
0
].
match
(
item
,
wildcard_character
);
};
});
});
todo
query_class_dict
.
complex
=
ComplexQuery
;
query_class_dict
.
complex
=
ComplexQuery
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment