Newer
Older
TB_Chris / TbUT / src / .svn / text-base / TbUTAlbavaFileValidator.cpp.svn-base
@iaro iaro on 9 May 2016 771 bytes first attempt of automated anal
  1. /*
  2. * TbUTAlbavaFileValidator.cpp
  3. *
  4. * Created on: Oct 5, 2014
  5. * Author: ADendek
  6. */
  7. #include "TbUTAlbavaFileValidator.h"
  8. #include <string>
  9. #include <iostream>
  10. using namespace TbUT;
  11. using namespace boost::filesystem;
  12. using namespace std;
  13.  
  14.  
  15. AlbavaFileValidator:: AlbavaFileValidator( std::string& p_filename):
  16. m_filename(p_filename)
  17. {
  18. }
  19.  
  20. bool AlbavaFileValidator::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 AlbavaFileValidator::isfileExist()
  31. {
  32. return exists(m_path);
  33. }
  34.  
  35. bool AlbavaFileValidator::isRegularFile()
  36. {
  37. return is_regular_file(m_path);
  38. }
  39.  
  40. bool AlbavaFileValidator::hasNonZeroSize()
  41. {
  42. return !(0==file_size(m_path));
  43. }