MemFileInputFiled.cpp 601 B

1234567891011121314151617181920212223242526272829303132333435
  1. #include "StdAfx.h"
  2. #include "MemFileInputFiled.h"
  3. CMemFileInputFiled::CMemFileInputFiled( CString filed_name,CString filed_value,CMemFile * file ):CInputFiled(filed_name,filed_value,INPUT_FILED_FILE)
  4. {
  5. this->m_file= file;
  6. }
  7. CMemFileInputFiled::~CMemFileInputFiled(void)
  8. {
  9. m_file = NULL;
  10. }
  11. unsigned long CMemFileInputFiled::DataSize()
  12. {
  13. return m_file->GetLength();
  14. }
  15. void CMemFileInputFiled::Open()
  16. {
  17. m_file->SeekToBegin();
  18. }
  19. void CMemFileInputFiled::Close()
  20. {
  21. m_file->Close();
  22. }
  23. int CMemFileInputFiled::Read( void* buffer,int buffer_size )
  24. {
  25. return m_file->Read(buffer,buffer_size);
  26. }