Author Topic: Can I use patternmatching lib in c++ under LMCE ?  (Read 6460 times)

bulek

  • Administrator
  • wants to work for LinuxMCE
  • *****
  • Posts: 909
  • Living with LMCE
    • View Profile
Can I use patternmatching lib in c++ under LMCE ?
« 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

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

Thanks in advance,

regards,

Bulek.
Thanks in advance,

regards,

Bulek.

coley

  • Guru
  • ****
  • Posts: 492
    • View Profile
Re: Can I use patternmatching lib in c++ under LMCE ?
« Reply #1 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.

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Can I use patternmatching lib in c++ under LMCE ?
« Reply #2 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

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Can I use patternmatching lib in c++ under LMCE ?
« Reply #3 on: December 16, 2008, 11:59:43 am »
bulek, no offense, but this is not perl :-)))

br, Hari
rock your home - http://www.agocontrol.com home automation

bulek

  • Administrator
  • wants to work for LinuxMCE
  • *****
  • Posts: 909
  • Living with LMCE
    • View Profile
Re: Can I use patternmatching lib in c++ under LMCE ?
« Reply #4 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.
Thanks in advance,

regards,

Bulek.

totallymaxed

  • LinuxMCE God
  • ****
  • Posts: 4660
  • Smart Home Consulting
    • View Profile
    • Dianemo - at home with technology
Re: Can I use patternmatching lib in c++ under LMCE ?
« Reply #5 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

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
Andy Herron,
CHT Ltd

For Dianemo/LinuxMCE consulting advice;
@herron on Twitter, totallymaxed+inquiries@gmail.com via email or PM me here.

Get Dianemo-Rpi2 ARM Licenses http://forum.linuxmce.org/index.php?topic=14026.0

Get RaspSqueeze-CEC or Raspbmc-CEC for Dianemo/LinuxMCE: http://wp.me/P4KgIc-5P

Facebook: https://www.facebook.com/pages/Dianemo-Home-Automation/226019387454465

http://www.dianemo.co.uk

bulek

  • Administrator
  • wants to work for LinuxMCE
  • *****
  • Posts: 909
  • Living with LMCE
    • View Profile
Re: Can I use patternmatching lib in c++ under LMCE ?
« Reply #6 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

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

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.
Thanks in advance,

regards,

Bulek.