BsPlainText.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsPrerequisites.h"
  5. #include "BsResource.h"
  6. namespace BansheeEngine
  7. {
  8. /** @addtogroup Resources-Engine
  9. * @{
  10. */
  11. /** A resource containing plain text data. */
  12. class BS_EXPORT PlainText : public Resource
  13. {
  14. public:
  15. /** Returns the text contained in the resource. */
  16. const WString& getString() const { return mString; }
  17. /** Modifies the text contained in the resource. */
  18. void setString(const WString& data) { mString = data; }
  19. /** Creates a new text file resource with the specified string. */
  20. static HPlainText create(const WString& data);
  21. /** @name Internal
  22. * @{
  23. */
  24. /**
  25. * Creates an include file resource with the specified include string.
  26. *
  27. * @note Internal method. Use create() for normal use.
  28. */
  29. static SPtr<PlainText> _createPtr(const WString& data);
  30. /** @} */
  31. private:
  32. PlainText(const WString& data);
  33. WString mString;
  34. /************************************************************************/
  35. /* SERIALIZATION */
  36. /************************************************************************/
  37. public:
  38. friend class PlainTextRTTI;
  39. static RTTITypeBase* getRTTIStatic();
  40. virtual RTTITypeBase* getRTTI() const override;
  41. };
  42. /** @} */
  43. }