LinuxMCE Forums

General => Developers => Topic started by: bulek on December 15, 2008, 04:12:13 pm

Title: Can I use patternmatching lib in c++ under LMCE ?
Post by: bulek on December 15, 2008, 04:12:13 pm
Hi,

I'm working on Climate plugin, I think I'm on the right track of implementing system that would give a lot of freedom in determining what is displayed on floorplans for certain devices (see Climate plugin thread on same forum).

For implementation I need some basic pattern matching and substitute features. In c++ it seems that Boost.regex is the answer :
http://www.onlamp.com/pub/a/onlamp/2006/04/06/boostregex.html?page=1 (http://www.onlamp.com/pub/a/onlamp/2006/04/06/boostregex.html?page=1)

Can I use that or are there any concerns about usage of this additional library?

Thanks in advance,

regards,

Bulek.
Title: Re: Can I use patternmatching lib in c++ under LMCE ?
Post by: coley on December 16, 2008, 02:02:12 am
Do you need all the functionality of this? What are you trying to achieve - I had a quick look at your climate plug-in thread but not at any of the source you were attempting to modify, which files out of interest? Does gnu regex (regex.h) or PCRE even, not give you what you are looking for - possibly not as fast as boost or boost+ but for lightweight pattern matching should be fine.

-Coley.
Title: Re: Can I use patternmatching lib in c++ under LMCE ?
Post by: tschak909 on December 16, 2008, 05:02:11 am
I don't have a problem with this, so long as the license is GPL compatible. :)

-Thom
Title: Re: Can I use patternmatching lib in c++ under LMCE ?
Post by: hari on December 16, 2008, 11:59:43 am
bulek, no offense, but this is not perl :-)))

br, Hari
Title: Re: Can I use patternmatching lib in c++ under LMCE ?
Post by: bulek on December 16, 2008, 02:02:35 pm
bulek, no offense, but this is not perl :-)))

br, Hari
agree, but once you get used to it, you try to use it every where... Although, if you take a look, those libraries declare their feature ritchness in comparison to Perl regex functionality...

I'll probably get by with some custom string functions, no fear :-) ....

regards,

Bulek.
Title: Re: Can I use patternmatching lib in c++ under LMCE ?
Post by: totallymaxed on December 16, 2008, 02:07:20 pm
Hi,

I'm working on Climate plugin, I think I'm on the right track of implementing system that would give a lot of freedom in determining what is displayed on floorplans for certain devices (see Climate plugin thread on same forum).

For implementation I need some basic pattern matching and substitute features. In c++ it seems that Boost.regex is the answer :
http://www.onlamp.com/pub/a/onlamp/2006/04/06/boostregex.html?page=1 (http://www.onlamp.com/pub/a/onlamp/2006/04/06/boostregex.html?page=1)

Can I use that or are there any concerns about usage of this additional library?

Thanks in advance,

regards,

Bulek.


Hmmm... I thought you wanted to do this in Perl? So in which case why are you not just using Perl's Perlre regular expression engine?

Andrew
Title: Re: Can I use patternmatching lib in c++ under LMCE ?
Post by: bulek on December 17, 2008, 07:52:19 am
Hi,

I'm working on Climate plugin, I think I'm on the right track of implementing system that would give a lot of freedom in determining what is displayed on floorplans for certain devices (see Climate plugin thread on same forum).

For implementation I need some basic pattern matching and substitute features. In c++ it seems that Boost.regex is the answer :
http://www.onlamp.com/pub/a/onlamp/2006/04/06/boostregex.html?page=1 (http://www.onlamp.com/pub/a/onlamp/2006/04/06/boostregex.html?page=1)

Can I use that or are there any concerns about usage of this additional library?

Thanks in advance,

regards,

Bulek.


Hmmm... I thought you wanted to do this in Perl? So in which case why are you not just using Perl's Perlre regular expression engine?

Andrew
Cause Climate Plugin is in c++ and would like to keep it that way.... I've updated wiki page with this idea and I think I can implement that without regex engine (with few simple parsing functions). I'm more interesting what do you all think about those propositions. Basically they bring two novelties and first one already works beatifully on my floorplans:
- I have full control how and what to display for Climate devices
- I can even replace predefined states (COOL,AUTO;HEAT...) to custom strings (this could even be a way to translate those strings).....

I've updated wiki page with description of what has been done and what are my further propositions:
http://wiki.linuxmce.org/index.php/Climate_Plugin#Description_of_enhanced_710_plugin_and_ability_to_control_displayed_info_on_floorplans (http://wiki.linuxmce.org/index.php/Climate_Plugin#Description_of_enhanced_710_plugin_and_ability_to_control_displayed_info_on_floorplans)

BTW, I'd be happy to hear your discussion about those matters, cause you also seem to be involved with various devices on floorplans.... We also must clear out how to support blinds, drapes, shutters etc... Currently I have them in lighting floorplan as dimmable lights switch - quite a dirty duct tape solution...

Regards,

Bulek.