cmParsePHPCoverage.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmParsePHPCoverage_h
  4. #define cmParsePHPCoverage_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include <iosfwd>
  7. #include <string>
  8. class cmCTest;
  9. class cmCTestCoverageHandlerContainer;
  10. /** \class cmParsePHPCoverage
  11. * \brief Parse xdebug PHP coverage information
  12. *
  13. * This class is used to parse php coverage information produced
  14. * by xdebug. The data is stored as a php dump of the array
  15. * return by xdebug coverage. It is an array of arrays.
  16. */
  17. class cmParsePHPCoverage
  18. {
  19. public:
  20. cmParsePHPCoverage(cmCTestCoverageHandlerContainer& cont, cmCTest* ctest);
  21. bool ReadPHPCoverageDirectory(const char* dir);
  22. void PrintCoverage();
  23. private:
  24. bool ReadPHPData(const char* file);
  25. bool ReadArraySize(std::istream& in, int& size);
  26. bool ReadFileInformation(std::istream& in);
  27. bool ReadInt(std::istream& in, int& v);
  28. bool ReadCoverageArray(std::istream& in, std::string const&);
  29. bool ReadUntil(std::istream& in, char until);
  30. cmCTestCoverageHandlerContainer& Coverage;
  31. cmCTest* CTest;
  32. };
  33. #endif