5 #include <typeregister.h>
10 class TextModel
: public ContainerModel
{
12 static const std::string TYPENAME
;
13 static const TypeProxy
<TextModel
> PROXY
;
16 TextModel(INTEGER id
);
17 static const std::string
&getType();
18 static const std::string
*getSuper();
19 virtual const std::string
&getTypeName() const;
20 virtual void internalize(Reader
&reader
);
26 TextPiece(size_t len
);
27 virtual void read(Reader
&reader
) = 0;
28 virtual std::string
toString() = 0;
31 class LongPiece
: public TextPiece
{
35 LongPiece(size_t len
);
37 virtual void read(Reader
&reader
);
38 virtual std::string
toString();
41 class ShortPiece
: public TextPiece
{
45 ShortPiece(size_t len
);
47 virtual void read(Reader
&reader
);
48 virtual std::string
toString();
51 class ViewPiece
: public TextPiece
{
54 ViewPiece(Store
*view
);
55 virtual void read(Reader
&reader
);
56 virtual std::string
toString();
59 class StdTextModel
: public TextModel
{
61 static const std::string TYPENAME
;
62 static const TypeProxy
<StdTextModel
> PROXY
;
63 std::vector
<TextPiece
*> d_pieces
;
66 StdTextModel(INTEGER id
);
67 static const std::string
&getType();
68 static const std::string
*getSuper();
69 virtual const std::string
&getTypeName() const;
70 virtual void internalize(Reader
&reader
);
72 virtual std::string
toString();
77 #endif // _TEXTMODEL_H_