TEngine.h 876 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright (c) 2010 Nokia Corporation.
  3. */
  4. #ifndef __TENGINE_MAIN__
  5. #define __TENGINE_MAIN__
  6. #include <stdio.h>
  7. #include <stdlib.h>
  8. #include <string.h>
  9. #include "TBase.h"
  10. class CTFile : public ITBuffer
  11. {
  12. public:
  13. CTFile();
  14. CTFile( const TSBYTE *fileName );
  15. virtual ~CTFile();
  16. TSDWORD read( void *target, TSDWORD length ); // returns the nof bytes read.
  17. TSDWORD write( void *source, TSDWORD length ); // returns the nof bytes wrote.
  18. TSDWORD curPos(); // returns the current-file-position.
  19. TSDWORD seek( TSDWORD pos );
  20. TSDWORD length();
  21. void setPos( const TSDWORD pos = 0 );
  22. TSDWORD openNew( const TSBYTE *fname );
  23. TSDWORD openExisting( const TSBYTE *fname );
  24. TSDWORD close();
  25. protected:
  26. FILE *fileHandle;
  27. };
  28. #endif