PageRenderTime 20ms CodeModel.GetById 12ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/ghost/csvparser.h

http://ghostcb.googlecode.com/
C++ Header | 53 lines | 18 code | 4 blank | 31 comment | 0 complexity | 54c7ee490fd5d3bb3d9719dc22f2eec4 MD5 | raw file
 1#ifndef __CSVPARSE_H_2001_06_07__
 2#define __CSVPARSE_H_2001_06_07__
 3
 4/*
 5Copyright (c) 2001, Mayukh Bose
 6All rights reserved.
 7
 8Redistribution and use in source and binary forms, with or without
 9modification, are permitted provided that the following conditions are
10met:
11
12* Redistributions of source code must retain the above copyright notice,
13this list of conditions and the following disclaimer.  
14
15* Redistributions in binary form must reproduce the above copyright
16notice, this list of conditions and the following disclaimer in the
17documentation and/or other materials provided with the distribution.
18
19* Neither the name of Mayukh Bose nor the names of other
20contributors may be used to endorse or promote products derived from
21this software without specific prior written permission.
22
23THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34*/
35
36#include <string>
37using namespace std;
38
39class CSVParser {
40 private:
41  string m_sData;
42  string::size_type m_nPos;
43  void SkipSpaces(void);
44 public:
45  CSVParser();
46  const CSVParser & operator << (const string &sIn);
47  const CSVParser & operator << (const char *sIn);
48  CSVParser & operator >> (int &nOut);
49  CSVParser & operator >> (double &nOut);
50  CSVParser & operator >> (string &sOut);
51};
52
53#endif