[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-hardware-devel
Subject: Re: [Kde-hardware-devel] Solid device action predicates
From: Christopher Blauvelt <cblauvelt () gmail ! com>
Date: 2009-07-08 15:36:14
Message-ID: ffa898c90907080836t256ad630jf8f7fc29153e5285 () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
2009/7/7 Kevin Ottens <ervin@kde.org>
> On Thursday 2 July 2009 22:15:07 Ozan Çağlayan wrote:
> > Where can I find the complete reference of the predicate rules used in
> > solid device action files?
>
> It's currently missing. And for sure it'd deserve a page on techbase.
> Unfortunately no one stepped up for it yet, and I'm lacking the time and
> motivation to do it myself.
>
> The syntax is quite simple though, there's not that many constructs:
> * "[ termA OR termB ]" or "[ termA AND termB ]" for logical combinations;
> * "Interface.property == value" to match a given value for a given
> property
> if the given Interface is supported by the device;
> * "Interface.property & value" to match a given value but using the binary
> AND operator (checking if property has the value flag set).
>
> And then the | operator that you ask for below:
>
> > I'm seeing different usages of different
> > operators in many projects but I can't get the expected results when I
> > evaluate them using solid-hardware. One such example is the pipe
> operator:
> >
> > $ solid-hardware query "foo.bar == 'PropertyX|PropertyY'"
>
> Those are enums/flags values, so the syntax closely follow the C++ one by
> using a binary OR operator (pipe operator in C/C++).
>
> > looking at it, one can think that | acts like an OR operator between
> > PropertyX and PropertyY but that doesn't work in that way, so I wonder
> > what's the aim of that operator.
>
> It exactly acts like an OR operator, but the binary one so foo.bar == 'X|Y'
> means that foo.bar should have both X and Y.
>
I committed an example called tutorial7 under the examples folder that
should be a good starting point.
Chris
[Attachment #5 (text/html)]
<br><br>
<div class="gmail_quote">2009/7/7 Kevin Ottens <span dir="ltr"><<a \
href="mailto:ervin@kde.org">ervin@kde.org</a>></span><br> <blockquote \
class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: \
#ccc 1px solid"> <div class="im">On Thursday 2 July 2009 22:15:07 Ozan Çağlayan \
wrote:<br>> Where can I find the complete reference of the predicate rules used \
in<br>> solid device action files?<br><br></div>It's currently missing. And \
for sure it'd deserve a page on techbase.<br> Unfortunately no one stepped up for \
it yet, and I'm lacking the time and<br>motivation to do it myself.<br><br>The \
syntax is quite simple though, there's not that many constructs:<br> * "[ \
termA OR termB ]" or "[ termA AND termB ]" for logical \
combinations;<br>
* "Interface.property == value" to match a given value for a given \
property<br>if the given Interface is supported by the device;<br> * \
"Interface.property & value" to match a given value but using the \
binary<br> AND operator (checking if property has the value flag set).<br><br>And \
then the | operator that you ask for below:<br> <div class="im"><br>> I'm \
seeing different usages of different<br>> operators in many projects but I \
can't get the expected results when I<br>> evaluate them using solid-hardware. \
One such example is the pipe operator:<br> ><br>> $ solid-hardware query \
"foo.bar == 'PropertyX|PropertyY'"<br><br></div>Those are \
enums/flags values, so the syntax closely follow the C++ one by<br>using a binary OR \
operator (pipe operator in C/C++).<br>
<div class="im"><br>> looking at it, one can think that | acts like an OR operator \
between<br>> PropertyX and PropertyY but that doesn't work in that way, so I \
wonder<br>> what's the aim of that operator.<br> <br></div>It exactly acts \
like an OR operator, but the binary one so foo.bar == 'X|Y'<br>means that \
foo.bar should have both X and Y.<br></blockquote> <div>I committed an example called \
tutorial7 under the examples folder that should be a good starting point.</div> \
<div>Chris</div></div>
_______________________________________________
Kde-hardware-devel mailing list
Kde-hardware-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-hardware-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic