src/inc/common.h 1.168

1.168 2010/03/18 01:53:09 tdreszer
Needed another flavor of chopByWhite that respects quotes
Index: src/inc/common.h
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/inc/common.h,v
retrieving revision 1.167
retrieving revision 1.168
diff -b -B -U 4 -r1.167 -r1.168
--- src/inc/common.h	10 Mar 2010 19:44:59 -0000	1.167
+++ src/inc/common.h	18 Mar 2010 01:53:09 -0000	1.168
@@ -812,8 +812,17 @@
 
 #define chopLine(line, words) chopByWhite(line, words, ArraySize(words))
 /* Chop line by white space. */
 
+int chopByWhiteRespectDoubleQuotes(char *in, char *outArray[], int outSize);
+/* Like chopString, but specialized for white space separators.
+ * Further, any doubleQuotes (") are respected.
+ * If doubleQuote encloses whole string, then they are removed:
+ *   "Fred and Ethyl" results in word [Fred and Ethyl]
+ * If doubleQuotes exist inside string they are retained:
+ *   Fred "and Ethyl" results in word [Fred "and Ethyl"]
+ * Special note "" is a valid, though empty word. */
+
 int chopByChar(char *in, char chopper, char *outArray[], int outSize);
 /* Chop based on a single character. */
 
 #define chopTabs(string, words) chopByChar(string, '\t', words, ArraySize(words))