/[svn]/jlscp/trunk/src/org/linuxsampler/lscp/Parser.java
ViewVC logotype

Diff of /jlscp/trunk/src/org/linuxsampler/lscp/Parser.java

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

revision 1201 by iliev, Mon Apr 2 20:43:58 2007 UTC revision 1202 by iliev, Thu May 24 20:17:25 2007 UTC
# Line 156  final class Parser { Line 156  final class Parser {
156                                    
157                  return far;                  return far;
158          }          }
           
159          /**          /**
160           * Parses a comma separated list whose items are encapsulated into apostrophes.           * Parses a comma separated list whose items are encapsulated into apostrophes.
          *  
161           * @param list The comma separated list.           * @param list The comma separated list.
162           * @return A <code>String</code> array containing all items in the list.           * @return A <code>String</code> array containing all items in the list.
          *  
163           * @throws LscpException if the list is broken.           * @throws LscpException if the list is broken.
164           */           */
165          protected static String[]          protected static String[]
166          parseStringList(String list) throws LscpException {          parseStringList(String list) throws LscpException {
167                    return parseStringList(list, ',');
168            }
169            
170            /**
171             * Parses a list whose items are encapsulated into apostrophes.
172             * @param list The list of strings.
173             * @param separator Provides the character used as separator.
174             * @return A <code>String</code> array containing all items in the list.
175             * @throws LscpException if the list is broken.
176             */
177            protected static String[]
178            parseStringList(String list, char separator) throws LscpException {
179                  if(list == null || list.length() == 0) return new String[0];                  if(list == null || list.length() == 0) return new String[0];
180                  int q1 = 0, q2 = 0;                  int q1 = 0, q2 = 0;
181                  Vector<String> v = new Vector<String>();                  Vector<String> v = new Vector<String>();
# Line 180  final class Parser { Line 189  final class Parser {
189                                                    
190                          if(q2 + 1 >= list.length()) break;                          if(q2 + 1 >= list.length()) break;
191                                                    
192                          if(list.charAt(q2 + 1) != ',')                          if(list.charAt(q2 + 1) != separator)
193                                  throw new LscpException(LscpI18n.getLogMsg("Parser.brokenList!"));                                  throw new LscpException(LscpI18n.getLogMsg("Parser.brokenList!"));
194                          q1 = q2 + 2;                          q1 = q2 + 2;
195                          if(q1 >= list.length())                          if(q1 >= list.length())

Legend:
Removed from v.1201  
changed lines
  Added in v.1202

  ViewVC Help
Powered by ViewVC