LineByLineDependencyScanner.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include "SpecializedDependencyScanner.h"
  10. #include <AzCore/std/string/regex.h>
  11. namespace AssetProcessor
  12. {
  13. /// Scans a given file stream for anything that looks like a path, asset ID, or UUID.
  14. class LineByLineDependencyScanner : public SpecializedDependencyScanner
  15. {
  16. public:
  17. bool ScanFileForPotentialDependencies(AZ::IO::GenericStream& fileStream, PotentialDependencies& potentialDependencies, int maxScanIteration) override;
  18. bool DoesScannerMatchFileData(AZ::IO::GenericStream& fileStream) override;
  19. bool DoesScannerMatchFileExtension(const AZStd::string& fullPath) override;
  20. AZStd::string GetVersion() const override;
  21. AZStd::string GetName() const override;
  22. AZ::Crc32 GetScannerCRC() const override;
  23. enum class SearchResult
  24. {
  25. Completed,
  26. ScanLimitHit,
  27. };
  28. protected:
  29. SearchResult ScanStringForMissingDependencies(
  30. const AZStd::string& scanString,
  31. int maxScanIteration,
  32. const AZStd::regex& subIdRegex,
  33. const AZStd::regex& uuidRegex,
  34. const AZStd::regex& pathRegex,
  35. PotentialDependencies& potentialDependencies);
  36. };
  37. }