2
0

BsPlainText.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #pragma once
  2. #include "BsPrerequisites.h"
  3. #include "BsResource.h"
  4. namespace BansheeEngine
  5. {
  6. /**
  7. * @brief Raw text resource.
  8. */
  9. class BS_EXPORT PlainText : public Resource
  10. {
  11. public:
  12. /**
  13. * @brief Returns the text contained in the resource.
  14. */
  15. const WString& getString() const { return mString; }
  16. /**
  17. * @brief Modifies the text contained in the resource.
  18. */
  19. void setString(const WString& data) { mString = data; }
  20. /**
  21. * @brief Creates a new text file resource with the specified string.
  22. */
  23. static HPlainText create(const WString& data);
  24. /**
  25. * @brief Creates an include file resource with the specified include string.
  26. *
  27. * @note Internal method. Use "create" for normal use.
  28. */
  29. static PlainTextPtr _createPtr(const WString& data);
  30. private:
  31. PlainText(const WString& data);
  32. WString mString;
  33. /************************************************************************/
  34. /* SERIALIZATION */
  35. /************************************************************************/
  36. public:
  37. friend class PlainTextRTTI;
  38. static RTTITypeBase* getRTTIStatic();
  39. virtual RTTITypeBase* getRTTI() const;
  40. };
  41. }