Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
925 B

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. // TokenLine.h: interface for the CommandLine class.
  3. //
  4. //////////////////////////////////////////////////////////////////////
  5. #ifndef TOKENLINE_H
  6. #define TOKENLINE_H
  7. #pragma once
  8. #define MAX_LINE_TOKENS 128
  9. #define MAX_LINE_CHARS 2048
  10. class TokenLine
  11. {
  12. public:
  13. TokenLine();
  14. TokenLine( char * string);
  15. virtual ~TokenLine();
  16. char * GetRestOfLine(int i); // returns all chars after token i
  17. int CountToken(); // returns number of token
  18. char * CheckToken(char * parm);// returns token after token parm or ""
  19. char * GetToken(int i); // returns token i
  20. char * GetLine(); // returns full line
  21. bool SetLine (const char * newLine); // set new token line and parses it
  22. char m_tokenBuffer[MAX_LINE_CHARS];
  23. char m_fullLine[MAX_LINE_CHARS];
  24. char * m_token[MAX_LINE_TOKENS];
  25. int m_tokenNumber;
  26. };
  27. #endif // !defined TOKENLINE_H