mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-16 06:05:58 -06:00
28 lines
555 B
C++
28 lines
555 B
C++
#ifndef _csvImport_h_
|
|
#define _csvImport_h_
|
|
|
|
struct csvResult
|
|
{
|
|
Vector<String> fields ;
|
|
Vector< Vector<String> > values ;
|
|
|
|
bool ImportFrom( const String& filePath ) ;
|
|
} ;
|
|
|
|
// CSVParser inspirated in code from other people ......
|
|
class CSVParser {
|
|
private:
|
|
String sData;
|
|
int nPos;
|
|
String GetNext();
|
|
|
|
int separator ;
|
|
public:
|
|
CSVParser();
|
|
void SetSeparator(int sep ) { separator = sep ; }
|
|
|
|
Vector<String> ParseLine(const String &sIn);
|
|
Vector<String> ParseLine(const String &sIn, int fieldCount );
|
|
};
|
|
|
|
#endif
|