/[svn]/linuxsampler/trunk/src/drivers/DeviceParameter.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/drivers/DeviceParameter.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 226 by schoenebeck, Wed Aug 25 22:00:33 2004 UTC revision 483 by schoenebeck, Mon Mar 21 23:40:56 2005 UTC
# Line 3  Line 3 
3   *   LinuxSampler - modular, streaming capable sampler                     *   *   LinuxSampler - modular, streaming capable sampler                     *
4   *                                                                         *   *                                                                         *
5   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *
6     *   Copyright (C) 2005 Christian Schoenebeck                              *
7   *                                                                         *   *                                                                         *
8   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
9   *   it under the terms of the GNU General Public License as published by  *   *   it under the terms of the GNU General Public License as published by  *
# Line 65  namespace LinuxSampler { Line 66  namespace LinuxSampler {
66          else { // if multiple strings or a string encapsulated into apostrophes          else { // if multiple strings or a string encapsulated into apostrophes
67              char* pStart = (char*) val.c_str();              char* pStart = (char*) val.c_str();
68              char* pC     = pStart;              char* pC     = pStart;
             if (*pC != '\'' && *pC != '\"') throw LinuxSamplerException("Invalid form, all individual strings should be encapsulated into apostrophes, separated by commas");  
69    
70              while (true) {              while (true) {
71                    if (*pC != '\'' && *pC != '\"') throw LinuxSamplerException("Invalid form, all individual strings should be encapsulated into apostrophes, separated by commas");
72    
73                  // search for token end                  // search for token end
74                  char* pTokenStart = pC + 1;                  char* pTokenStart = pC + 1;
75                  do {                  do {
# Line 75  namespace LinuxSampler { Line 77  namespace LinuxSampler {
77                      if (*pC == '\0') throw LinuxSamplerException("Invalid form, all individual strings should be encapsulated into apostrophes, separated by commas");                      if (*pC == '\0') throw LinuxSamplerException("Invalid form, all individual strings should be encapsulated into apostrophes, separated by commas");
78                  }                  }
79                  while (*pC != '\'' && *pC != '\"');                  while (*pC != '\'' && *pC != '\"');
80                  vS.push_back(val.substr((int)(pTokenStart - pStart), (int)(pC - pTokenStart))); // we found the token's end                  String token = val.substr((int)(pTokenStart - pStart), (int)(pC - pTokenStart));
81                    vS.push_back(token); // we found the token's end
82    
83                  // now there should be either a comma or the end of the total string                  // now there should be either a comma or the end of the total string
84                  if (*(++pC) == '\0') break;                  if (*(++pC) == '\0') break;
85                  if (*pC != ',') throw LinuxSamplerException("Invalid form, all individual strings should be encapsulated into apostrophes, separated by commas");                  if (*pC != ',') throw LinuxSamplerException("Invalid form, all individual strings should be encapsulated into apostrophes, separated by commas");
86                    pC++;
87              }              }
88          }          }
89    

Legend:
Removed from v.226  
changed lines
  Added in v.483

  ViewVC Help
Powered by ViewVC