#include <config.h>
-#ifdef __GNUG__
-#pragma implementation
-#endif
#include "insetcommandparams.h"
#include "lyxlex.h"
{}
-string const InsetCommandParams::getAsString() const
-{
- return cmdname + "|++|" + contents + "|++|" + options;
-}
-
-
-void InsetCommandParams::setFromString(string const & b)
-{
- string::size_type idx = b.find("|++|");
- if (idx == string::npos) {
- cmdname = b;
- contents = "";
- options = "";
- return;
- }
-
- cmdname = b.substr(0, idx);
- string tmp = b.substr(idx+4);
-
- idx = tmp.find("|++|");
- if (idx == string::npos) {
- contents = tmp;
- options = "";
- } else {
- contents = tmp.substr(0, idx);
- options = tmp.substr(idx+4);
- }
-}
-
-
void InsetCommandParams::scanCommand(string const & cmd)
{
string tcmdname, toptions, tcontents;
string const InsetCommandParams::getCommand() const
{
string s;
- if (!getCmdName().empty()) s += "\\"+getCmdName();
- if (!getOptions().empty()) s += "["+getOptions()+']';
- s += "{"+getContents()+'}';
+ if (!getCmdName().empty()) s += '\\' + getCmdName();
+ if (!getOptions().empty()) s += '[' + getOptions() + ']';
+ s += '{' + getContents() + '}';
return s;
}