Re: [ecasound] long file names in IAM

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [ecasound] long file names in IAM
From: Junichi Uekawa (dancer_AT_netfort.gr.jp)
Date: Thu Dec 20 2001 - 04:27:10 EET


On Thu, 20 Dec 2001 00:59:32 +0200 (EET)
Kai Vehmanen <k_AT_eca.cx> wrote:

Hi,

> If anyone's interested in working on this, the main task is to write a new
> version of ecasound/kvutils/kvutils.cpp:string_to_words(), possibly
> string_to_words_quoted(), which is intelligent enough to notice quotes
> and/or escaped spaces. The function is about under 20 lines of code, so
> it's not an impossible task. :)

Although not tested, I thought something as trivial as this should work ?

--- kvutils.cpp.~1.8.~ Tue Nov 20 18:04:25 2001
+++ kvutils.cpp Thu Dec 20 11:19:18 2001
@@ -32,9 +32,17 @@
 std::vector<std::string> string_to_words(const std::string& s) {
   std::vector<std::string> vec;
   std::string stmp = "";
+ int quoteflag = false;
 
   for(std::string::const_iterator p = s.begin(); p != s.end(); p++) {
- if (isspace(*p) == false)
+ if (*p == '\"')
+ quoteflag = !quoteflag;
+ else if (*p == '\\')
+ {
+ p++;
+ stmp += *p;
+ }
+ else if (isspace(*p) == false || quoteflag)
       stmp += *p;
     else {
       if (stmp == "") continue;

-- 
dancer_AT_debian.org  http://www.netfort.gr.jp/~dancer

-- To unsubscribe send message 'unsubscribe' in the body of the message to <ecasound-list-request_AT_wakkanet.fi>.


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Thu Dec 20 2001 - 04:23:27 EET