LiteralString.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. #pragma once
  6. namespace Js
  7. {
  8. class LiteralString : public JavascriptString
  9. {
  10. protected:
  11. LiteralString(StaticType* type);
  12. LiteralString(StaticType* type, const wchar_t* content, charcount_t charLength);
  13. DEFINE_VTABLE_CTOR(LiteralString, JavascriptString);
  14. DECLARE_CONCRETE_STRING_CLASS;
  15. public:
  16. static LiteralString* New(StaticType* type, const wchar_t* content, charcount_t charLength, Recycler* recycler);
  17. static LiteralString* CreateEmptyString(StaticType* type);
  18. };
  19. class ArenaLiteralString sealed : public JavascriptString
  20. {
  21. protected:
  22. ArenaLiteralString(StaticType* type, const wchar_t* content, charcount_t charLength);
  23. DEFINE_VTABLE_CTOR(ArenaLiteralString, JavascriptString);
  24. DECLARE_CONCRETE_STRING_CLASS;
  25. public:
  26. static ArenaLiteralString* New(StaticType* type, const wchar_t* content, charcount_t charLength, Recycler* recycler);
  27. static ArenaLiteralString* New(StaticType* type, const wchar_t* content, charcount_t charLength, ArenaAllocator* arena);
  28. virtual RecyclableObject * CloneToScriptContext(ScriptContext* requestContext) override;
  29. };
  30. }