XmlUtils.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. #ifndef CRYINCLUDE_CRYSYSTEM_XML_XMLUTILS_H
  9. #define CRYINCLUDE_CRYSYSTEM_XML_XMLUTILS_H
  10. #pragma once
  11. #include "ISystem.h"
  12. #ifdef _RELEASE
  13. #define CHECK_STATS_THREAD_OWNERSHIP()
  14. #else
  15. #define CHECK_STATS_THREAD_OWNERSHIP() if (m_statsThreadOwner != CryGetCurrentThreadId()) {__debugbreak(); }
  16. #endif
  17. class CXmlNodePool;
  18. //////////////////////////////////////////////////////////////////////////
  19. // Implements IXmlUtils interface.
  20. //////////////////////////////////////////////////////////////////////////
  21. class CXmlUtils
  22. : public IXmlUtils
  23. {
  24. public:
  25. CXmlUtils(ISystem* pSystem);
  26. virtual ~CXmlUtils();
  27. //////////////////////////////////////////////////////////////////////////
  28. // IXmlUtils
  29. //////////////////////////////////////////////////////////////////////////
  30. virtual IXmlParser* CreateXmlParser();
  31. // Load xml from file, returns 0 if load failed.
  32. virtual XmlNodeRef LoadXmlFromFile(const char* sFilename, bool bReuseStrings = false);
  33. // Load xml from memory buffer, returns 0 if load failed.
  34. virtual XmlNodeRef LoadXmlFromBuffer(const char* buffer, size_t size, bool bReuseStrings = false, bool bSuppressWarnings = false);
  35. virtual IXmlSerializer* CreateXmlSerializer();
  36. // Create XML Table reader.
  37. virtual IXmlTableReader* CreateXmlTableReader();
  38. //////////////////////////////////////////////////////////////////////////
  39. private:
  40. ISystem* m_pSystem;
  41. };
  42. #endif // CRYINCLUDE_CRYSYSTEM_XML_XMLUTILS_H