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 * |
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 { |
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 |
|
|