FileInputFiled.cpp 634 B

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