It is becoming clear that people are developing lots of ad hoc ways of
extracting their personal version of InsetCommand from a single string. This
can only get worse as the new GUI independent stuff is built upon. 

Can I propose, therefore, a new holder class InsetCommandParams?
InsetCommand would contain a single instance of this class which yould deal
with all the cmdname, options and contents stuff itself. The clas is outlined
below. Note the two new functions, bufferGet() and bufferSet() which will allow
this manipulation.

Any thoughts?
Angus

class InsetCommandParams {
        ///
        explicit
        InsetCommandParams( string const & n,
                            string const & o = string(), 
                            string const & c = string() );
        ///
        string const & getCmdName() const { return cmdname; }
        ///
        string const & getOptions() const { return options; }
        ///
        string const & getContents() const { return contents; }
        ///
        void setCmdName( string const & n ) { cmdname = n; }
        ///
        void setOptions(string const & o) { options = o; }
        ///
        void setContents(string const & c) { contents = c; }
        ///
        void addContents(string const & c) { contents += c; }
        ///
        string bufferGet() const;
        ///
        void bufferSet( string const & );

private:
        ///    
        string cmdname;
        ///    
        string options;
        ///    
        string contents;
};

Reply via email to