Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] Config file parsing?

Date2006-02-12 18:25
FromMichael Gogins
SubjectRe: [Cs-dev] Config file parsing?
My confusion, I thought you meant command line not configuration file.

The boost program_options library handles configuration files as well as command lines.

The csound5/frontends/CsoundVST/CsoundFile.cpp file has examples of parsing CSD files, by reading a line at a time and looking for tags. It would be easy to adapt this to looking for equals signs.

Regards,
Mike


-----Original Message-----
>From: Iain Duncan 
>Sent: Feb 11, 2006 11:21 PM
>To: csound-devel@lists.sourceforge.net
>Subject: Re: [Cs-dev] Config file parsing?
>
>> There's the getopt librqry (GNU) and boost also has a facility (the program_options library). Getopt is pretty standard in GNU/Linux C programming.
>> 
>> Regards,
>> Mike
>
>I just looked up an example and it demonstrated using this with command 
>line args. I'm hoping to parse a config file much like the style apache 
>uses, is this the right option for that kind of thing? How does one 
>adapt it for that?
>
>I could see that I could just open the config file and parse through all 
>the lines using regexp's, but maybe that is not the smart way to do it?
>
>Iain
>
>> -----Original Message-----
>> 
>>>From: Iain Duncan 
>>>Sent: Feb 11, 2006 10:46 PM
>>>To: csound-devel@lists.sourceforge.net
>>>Subject: [Cs-dev] Config file parsing?
>>>
>>>I'm going to add some config file options to my front end, in a standard 
>>>unixish manner. I am wondering if there is a good library or tool for 
>>>doing this in C++. Also, if csound5 uses one for the csoundrc file and 
>>>other config options, I would like to use the same one. Any suggestions?
>>>
>>>Thanks
>>>Iain
>>>
>>>
>>>-------------------------------------------------------
>>>This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
>>>for problems?  Stop!  Download the new AJAX search engine that makes
>>>searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
>>>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
>>>_______________________________________________
>>>Csound-devel mailing list
>>>Csound-devel@lists.sourceforge.net
>>>https://lists.sourceforge.net/lists/listinfo/csound-devel
>> 
>> 
>> 
>> 
>> 
>> 
>> -------------------------------------------------------
>> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
>> for problems?  Stop!  Download the new AJAX search engine that makes
>> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> 
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
>for problems?  Stop!  Download the new AJAX search engine that makes
>searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
>_______________________________________________
>Csound-devel mailing list
>Csound-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/csound-devel





-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2006-02-12 20:29
FromIain Duncan
SubjectRe: [Cs-dev] Config file parsing?
> My confusion, I thought you meant command line not configuration file.

No worries, it was worth looking at anyway. ;)

> The boost program_options library handles configuration files as well as command lines.
> 
> The csound5/frontends/CsoundVST/CsoundFile.cpp file has examples of parsing CSD files, by reading a line at a time and looking for tags. It would be easy to adapt this to looking for equals signs.

I was thinking of doing much the same thing using the boost regex 
library, is that a bad idea? Is it overkill? It seems the natural way 
for me just because that's what I'm used to using with python, but 
perhaps it will be needlessly slow.

Thanks for the tip,
Iain



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net