Tokenizer.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //#include "stdafx.h"
  2. //#include "Tokenizer.h"
  3. //
  4. //CTokenizer::CTokenizer(const CString &cs, const CString &csDelim): m_cs(cs), m_nCurPos(0)
  5. //{
  6. // SetDelimiters(csDelim);
  7. //}
  8. //
  9. //void CTokenizer::SetDelimiters(const CString &csDelim)
  10. //{
  11. // for(int i = 0; i < csDelim.GetLength(); ++i)
  12. // {
  13. // m_delim.Add(csDelim[i]);
  14. // }
  15. //
  16. // m_delim.SortAscending();
  17. //}
  18. //
  19. //bool CTokenizer::Next(CString &cs)
  20. //{
  21. // cs.Empty();
  22. // int len = m_cs.GetLength();
  23. //
  24. // while(m_nCurPos < len && m_delim.Find(m_cs[m_nCurPos]))
  25. // {
  26. // ++m_nCurPos;
  27. // }
  28. //
  29. // if(m_nCurPos >= len)
  30. // {
  31. // return false;
  32. // }
  33. //
  34. // int nStartPos = m_nCurPos;
  35. //
  36. // while(m_nCurPos < len && !m_delim.Find(m_cs[m_nCurPos]))
  37. // {
  38. // ++m_nCurPos;
  39. // }
  40. //
  41. // cs = m_cs.Mid(nStartPos, m_nCurPos - nStartPos);
  42. //
  43. // return true;
  44. //}
  45. //
  46. //CString CTokenizer::Tail()
  47. //{
  48. // int len = m_cs.GetLength();
  49. // int nCurPos = m_nCurPos;
  50. //
  51. // while(nCurPos < len && m_delim.Find(m_cs[nCurPos]))
  52. // {
  53. // ++nCurPos;
  54. // }
  55. //
  56. // CString csResult;
  57. // if(nCurPos < len)
  58. // {
  59. // csResult = m_cs.Mid(nCurPos);
  60. // }
  61. //
  62. // return csResult;
  63. //}