cstring_item.hpp (861B)
1 #ifndef UUID_94EB7F8A_BDE7_47F7_9B17_BF00A9A3EEBB 2 #define UUID_94EB7F8A_BDE7_47F7_9B17_BF00A9A3EEBB 3 #pragma once 4 5 #include "item.hpp" 6 #include "../source.hpp" 7 8 namespace Neptools 9 { 10 11 class CStringItem final : public Item 12 { 13 LIBSHIT_DYNAMIC_OBJECT; 14 public: 15 CStringItem(Key k, Context& ctx, std::string string) 16 : Item{k, ctx}, string{std::move(string)} {} 17 CStringItem(Key k, Context& ctx, const Source& src); 18 static CStringItem& CreateAndInsert(ItemPointer ptr); 19 FilePosition GetSize() const noexcept override { return string.size() + 1; } 20 21 static std::string GetLabelName(std::string string); 22 std::string GetLabelName() const { return GetLabelName(string); } 23 24 std::string string; 25 26 private: 27 void Dump_(Sink& sink) const override; 28 void Inspect_(std::ostream& os, unsigned indent) const override; 29 }; 30 31 } 32 33 #endif