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.

58 lines
1.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef TOOLDEMOFILE_H
  7. #define TOOLDEMOFILE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "mathlib/vector.h"
  12. #include "tier0/platform.h"
  13. #include "utlvector.h"
  14. #include "filesystem.h"
  15. #include "demofile/demoformat.h"
  16. class CUtlBuffer;
  17. class CToolDemoFile
  18. {
  19. public:
  20. CToolDemoFile();
  21. virtual ~CToolDemoFile();
  22. bool Open(const char *name, bool bReadOnly);
  23. bool IsOpen();
  24. void Close();
  25. void SeekTo( int position );
  26. unsigned int GetCurPos();
  27. int GetSize();
  28. int ReadRawData( char *buffer, int length );
  29. void ReadSequenceInfo(int &nSeqNrIn, int &nSeqNrOutAck);
  30. void ReadCmdInfo( democmdinfo_t& info );
  31. void ReadCmdHeader( unsigned char& cmd, int& tick );
  32. const char *ReadConsoleCommand( void );
  33. int ReadNetworkDataTables( CUtlBuffer *buf ); // if buf is NULL, skip it
  34. int ReadUserCmd( char *buffer, int &size );
  35. demoheader_t *ReadDemoHeader();
  36. public:
  37. FileHandle_t m_hDemoFile; // filesystem handle
  38. char m_szFileName[MAX_PATH]; //name of current demo file
  39. demoheader_t m_DemoHeader; //general demo info
  40. };
  41. #endif // TOOLDEMOFILE_H