#pragma once
#include "DllDefines.h"

constexpr auto MAX_PARSE_PARM       = 64;
constexpr auto MAX_TOK_LENGTH       = 15;
constexpr auto MAX_PARSE_STRING_LEN = 256;

class UTILITYDLL CTrivialCsvParser
{
public:
    CTrivialCsvParser();
    CTrivialCsvParser(TCHAR* tok, int nparm);

    ~CTrivialCsvParser();

    bool SetToken(TCHAR* tok);
    bool SetMaxParm(int maxParm);

    int Parse(TCHAR* inStr, TCHAR** parmList, TCHAR* tok, int maxParmExp, bool keepInputStrUnchanged = false);
    int Parse(TCHAR* inStr, TCHAR** parmList, int numParm);
    int Parse(TCHAR* inStr, TCHAR** parmList);

private:
    TCHAR buf[MAX_PARSE_STRING_LEN];
    TCHAR mTok[MAX_TOK_LENGTH + 1];
    int m_iParam;
};
