Merge pull request #506 from andrewcsmith/patch-2
[supercollider.git] / include / common / SC_StringParser.h
blobe36ad779cc42c50c6fd98af722d22d33489b9bba
1 // emacs: -*- c++ -*-
2 // file: SC_StringParser.h
3 // copyright: 2003-2006 stefan kersten
4 // cvs: $Id$
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License as
8 // published by the Free Software Foundation; either version 2 of the
9 // License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful, but
12 // WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
19 // USA
21 #ifndef _SC_StringParser_
22 #define _SC_StringParser_
24 #define SC_MAX_TOKEN_LENGTH 256
26 #ifdef _WIN32
27 #define SC_STRPARSE_PATHDELIMITER ';'
28 #else
29 #define SC_STRPARSE_PATHDELIMITER ':'
30 #endif
32 class SC_StringParser
34 const char *mSpec, *mStart, *mEnd;
35 char mSep, mBuf[SC_MAX_TOKEN_LENGTH];
37 public:
38 SC_StringParser();
39 SC_StringParser(const char *spec, char sep);
41 bool AtEnd() const;
42 const char *NextToken();
45 #endif