Newer
Older
TB_Chris / TbUT / src / .svn / text-base / TbUTPedestalFileValidator.cpp.svn-base
@iaro iaro on 9 May 2016 719 bytes first attempt of automated anal
  1. /*
  2. * TbUTPedestalFileValidator.cpp
  3. *
  4. * Created on: Jan 2, 2015
  5. * Author: ADendek
  6. */
  7.  
  8. #include "TbUTPedestalFileValidator.h"
  9.  
  10. using namespace TbUT;
  11. using namespace boost::filesystem;
  12.  
  13.  
  14. PedestalFileValidator::PedestalFileValidator(const std::string& p_filename):
  15. m_filename(p_filename)
  16. {
  17. }
  18.  
  19.  
  20. bool PedestalFileValidator::validateFile()
  21. {
  22. m_path=path(m_filename);
  23. bool l_result=
  24. isfileExist() &&
  25. isRegularFile() &&
  26. hasNonZeroSize();
  27. return l_result;
  28. }
  29.  
  30. bool PedestalFileValidator::isfileExist()
  31. {
  32. return exists(m_path);
  33. }
  34.  
  35. bool PedestalFileValidator::isRegularFile()
  36. {
  37. return is_regular_file(m_path);
  38. }
  39.  
  40. bool PedestalFileValidator::hasNonZeroSize()
  41. {
  42. return !(0==file_size(m_path));
  43. }