Laxkit
0.0.7.1
|
Class to provide do nothing place holders for dump_out, dump_in_atts, and a standard dump_in. More...
Public Member Functions | |
virtual void | dump_out (FILE *f, int indent, int what, Laxkit::anObject *savecontext)=0 |
what==0 means write out an Attribute formatted file. | |
virtual Attribute * | dump_out_atts (Attribute *att, int what, Laxkit::anObject *savecontext) |
Default is return NULL. what==0 means write out normal Attribute formatted things. | |
virtual void | dump_in (FILE *f, int indent, int what, Laxkit::anObject *loadcontext, Attribute **att) |
Read in a file segment as an Attribute, and pass parsing duties to dump_in_atts. | |
virtual void | dump_in_atts (Attribute *att, int flag, Laxkit::anObject *loadcontext)=0 |
Read the Attribute and take away what it can. | |
virtual | ~DumpUtility () |
Empty virtual destructor. |
Class to provide do nothing place holders for dump_out, dump_in_atts, and a standard dump_in.
These functions are used with the style of file where an items related elements are listed on following lines with a certain indentation, similar to how things are grouped in the Python language. The amount of indentation for the classes elements is specified in indent.
It provides abstract place holders for dump_out() and dump_in_atts(), and provides a dump_in() that reads in an Attribute, and passes it to dump_in_atts().
Derived classes would inherit like:
class Blah : virtual public DumpUtility, public WhateverOtherClass, ...
|
virtual |
Read in a file segment as an Attribute, and pass parsing duties to dump_in_atts.
The default function here ignores what (assumes it is 0). Creates a new Attribute, does newatt->dump_in(f,indent), then calls dump_in_atts(newatt,loadcontext). Puts the plain att in Att if Att!=NULL. Otherwise deletes the nem att.
what==0 means f is an Attribute formatted file. Other values of what can be used by subclasses to read in from other file formats, like a PathsData reading in an SVG, for instance.
loadcontext, if not NULL, will typically be something like a LaxInterfaces::LoadContext object.
Reimplemented in Laxkit::Palette.
References LaxFiles::Attribute::dump_in().
Referenced by Laxkit::ShortcutManager::Load().
|
pure virtual |
Read the Attribute and take away what it can.
Implemented in Laxkit::anXWindow, Laxkit::ShortcutManager, Laxkit::CurveWindow, LaxInterfaces::anInterface, Laxkit::RulerWindow, Laxkit::Scroller, LaxInterfaces::Path, Laxkit::MessageBar, Laxkit::DateSelector, Laxkit::Button, Laxkit::Palette, LaxInterfaces::LineStyle, and LaxInterfaces::FillStyle.
|
pure virtual |
what==0 means write out an Attribute formatted file.
what==-1 should mean write out a definition snippet that represents what attributes can be passed in to this object.
Implemented in Laxkit::anXWindow, Laxkit::ShortcutManager, LaxInterfaces::anInterface, LaxInterfaces::Path, Laxkit::Palette, LaxInterfaces::LineStyle, and LaxInterfaces::FillStyle.
|
inlinevirtual |
Default is return NULL. what==0 means write out normal Attribute formatted things.
If att==NULL, then create and return a new Attribute. Otherwise just append to att.
Reimplemented in Laxkit::anXWindow, Laxkit::CurveWindow, Laxkit::RulerWindow, Laxkit::Scroller, Laxkit::MessageBar, Laxkit::DateSelector, Laxkit::Button, and Laxkit::Palette.