string_data.hpp (684B)
1 #ifndef UUID_5AE4EF4E_E8EB_4A3D_90A7_58FA73AF7B71 2 #define UUID_5AE4EF4E_E8EB_4A3D_90A7_58FA73AF7B71 3 #pragma once 4 5 #include "../item.hpp" 6 7 namespace Neptools::Stcm 8 { 9 class DataItem; 10 11 class StringDataItem final : public Item 12 { 13 LIBSHIT_DYNAMIC_OBJECT; 14 public: 15 StringDataItem(Key k, Context& ctx, std::string str) 16 : Item{k, ctx}, string{std::move(str)} {} 17 18 static Libshit::RefCountedPtr<StringDataItem> 19 MaybeCreateAndReplace(DataItem& it); 20 21 FilePosition GetSize() const noexcept override; 22 23 std::string string; 24 25 private: 26 void Dump_(Sink& sink) const override; 27 void Inspect_(std::ostream& os, unsigned indent) const override; 28 }; 29 30 } 31 32 #endif