Newer
Older
TB_Chris / TbUT / src / .svn / text-base / TbUTChannelMaskFileValidator.cpp.svn-base
@iaro iaro on 9 May 2016 870 bytes first attempt of automated anal
  1. /*
  2. * TbUTChannelMaskFileValidator.cpp
  3. *
  4. * Created on: Oct 10, 2014
  5. * Author: ADendek
  6. */
  7.  
  8. #include "TbUTChannelMaskFileValidator.h"
  9. #include <iostream>
  10.  
  11. using namespace TbUT;
  12. using namespace boost::filesystem;
  13. using namespace std;
  14.  
  15. ChannelMaskFileValidator:: ChannelMaskFileValidator( std::string& p_filename):
  16. m_filename(p_filename)
  17. {
  18. }
  19.  
  20. bool ChannelMaskFileValidator::validateFile()
  21. {
  22. m_path=path(m_filename);
  23. bool l_result=
  24. isfileExist() &&
  25. isRegularFile() &&
  26. hasProperSize();
  27. return l_result;
  28. }
  29.  
  30. bool ChannelMaskFileValidator::isfileExist()
  31. {
  32. return exists(m_path);
  33. }
  34.  
  35. bool ChannelMaskFileValidator::isRegularFile()
  36. {
  37. return is_regular_file(m_path);
  38. }
  39.  
  40. bool ChannelMaskFileValidator::hasProperSize()
  41. {
  42. unsigned int l_expectedSieze=1024;
  43. cout<<file_size(m_path)<<endl;
  44. return l_expectedSieze==file_size(m_path);
  45. }