1//************************************ bs::framework - Copyright 2018 Marko Pintera **************************************//
2//*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********//
3#pragma once
4
5#include "BsPrerequisites.h"
6#include "Resources/BsResource.h"
7
8namespace bs
9{
10 /** @addtogroup Resources-Engine
11 * @{
12 */
13
14 /** A resource containing plain text data. */
15 class BS_EXPORT PlainText : public Resource
16 {
17 public:
18 /** Returns the text contained in the resource. */
19 const WString& getString() const { return mString; }
20
21 /** Modifies the text contained in the resource. */
22 void setString(const WString& data) { mString = data; }
23
24 /** Creates a new text file resource with the specified string. */
25 static HPlainText create(const WString& data);
26
27 /** @name Internal
28 * @{
29 */
30
31 /**
32 * Creates an include file resource with the specified include string.
33 *
34 * @note Internal method. Use create() for normal use.
35 */
36 static SPtr<PlainText> _createPtr(const WString& data);
37
38 /** @} */
39 private:
40 PlainText(const WString& data);
41
42 WString mString;
43
44 /************************************************************************/
45 /* SERIALIZATION */
46 /************************************************************************/
47 public:
48 friend class PlainTextRTTI;
49 static RTTITypeBase* getRTTIStatic();
50 virtual RTTITypeBase* getRTTI() const override;
51 };
52
53 /** @} */
54}