#include "stdafx.h"
#include "ComLin.h"

CComLine::CComLine() : CCommandLineInfo()
{
     m_argc=0;
}

void CComLine::ParseParam(LPCTSTR lpszParam,BOOL bFlag,BOOL bLast)
{
     INT offset;

     offset=(bFlag ? 2 : 1);
     if (m_argc < MAXARGS) {
          m_argv[m_argc]=new CHAR [strlen(lpszParam)+offset];
          if (bFlag) {
               strcpy(m_argv[m_argc],"-");
               strcat(m_argv[m_argc],lpszParam);
          }
          else {
               strcpy(m_argv[m_argc],lpszParam);
          }
          m_argc++;
     }
}

CComLine::~CComLine()
{
     INT index;

     for (index=0; index < m_argc; index++) {
          delete [] m_argv[index];
     }
     m_argc=0;
}