4#include "base/src/property.h"
5#include "utility/interface/itextinput.h"
72 virtual void tagLastInputForSmartUndo(
const string &label,uint64 maxLevel,
73 const string &undoCommand)=0;
133 virtual void addHelp(
const string &s)
const=0;
167 virtual RetCode isName(
string *ps=
nullptr,
IMark *p=
nullptr)
const=0;
187 virtual RetCode isMultiKeyword(
const string &key,std::vector<uint32> *pPos,
IMark *p=
nullptr)
const=0;
188 virtual RetCode isDVect2(DVect2 *pv=
nullptr,
IMark *p=
nullptr)
const=0;
230 virtual RetCode isFilename(
string *ps=
nullptr,
const string &def_ext={},
bool openForRead=
false,IMark *p=
nullptr)
const=0;
239 virtual bool toBool(
IMark *p=
nullptr,
bool implicitOn=
false)
const=0;
260 virtual string toName(
IMark *p=
nullptr)
const=0;
271 virtual uint32
toKeyword(
const string &key,
IMark *p=
nullptr)
const=0;
307 virtual string toFilename(
const string &def_ext={},
bool openForRead=
false,IMark *p=
nullptr)
const=0;
343 virtual void destroy()=0;
358 inline IParse::RetCode isDVect(
const IParse &par,DVect2 *v=
nullptr,IParse::IMark *m=
nullptr) {
return par.isDVect2(v,m); }
362 inline DVect2
toDVect(
const IParse &par,IParse::IMark *m=
nullptr) {
return par.toDVect2(m); }
364 inline DAVect2
toDAVect(
const IParse &par,IParse::IMark *m=
nullptr) {
return DAVect2(par.toDouble(m)); }
Definition basestring.h:71
A symmetric 2nd order tensor.
Definition symtensor.h:22
Opaque position indicator class. Do not attempt to use directly for anything.
Definition iparse.h:52
virtual void destroy()=0
Destroys this mark.
Interface to the main command processing class.
Definition iparse.h:49
virtual int64 toLong(IMark *p=nullptr, int64 lMin=limits< int64 >::min(), int64 lMax=limits< int64 >::max()) const =0
virtual const std::vector< InputLine > & getOriginalInput() const =0
Returns the original strings used to generate the set of command tokens.
virtual bool hasHelpToken() const =0
Return a boolean indicating whether or not a help token is in the token list.
virtual IVect2 getTokenExtent(IMark *p=nullptr) const =0
virtual uint32 toUInt(IMark *p=nullptr, uint32 uMin=0, uint32 uMax=limits< uint32 >::max()) const =0
virtual void addSkipPost(StringList *skipList, char c, IMark *p=nullptr) const =0
Adds a character to the start of the skip string AFTER the current token.
virtual RetCode isInt(int *pi=nullptr, IMark *p=nullptr, int iMin=limits< int >::min(), int iMax=limits< int >::max()) const =0
virtual bool checkSkipPre(StringList *skipList, char c, IMark *p=nullptr) const =0
virtual bool toBool(IMark *p=nullptr, bool implicitOn=false) const =0
virtual ITextOutput * getITextOutput()=0
Returns an ITextIO interface associated with this parser.
virtual ITextInput * getITextInput()=0
Returns an ITextInput interface associated with this parser.
virtual bool interactiveSource() const =0
Returns TRUE if the input source for the command being processed was interactive.
virtual void addHelp(const string &s) const =0
Adds a string representing a token type to the help list. Multiple matching Strings are filtered.
virtual SymTensor toSymTensor(IMark *p=nullptr) const =0
virtual RetCode isBool(bool *pb=nullptr, IMark *p=nullptr, bool implicitOn=false) const =0
virtual string toFilename(const string &def_ext={}, bool openForRead=false, IMark *p=nullptr) const =0
virtual void increment(IMark *p=nullptr) const =0
Increments the provided or internal mark.
virtual void setMark(IMark *pNew, IMark *p=nullptr) const =0
Sets the internal position indicator to p.
virtual int getLineNumber(IMark *p=nullptr) const =0
virtual DVect toDVect(IMark *p=0) const =0
virtual string toString(IMark *p=nullptr) const =0
virtual const ITextInput * getITextInput() const =0
Returns an ITextInput interface associated with this parser.
virtual RetCode isLong(int64 *pl=nullptr, IMark *p=nullptr, int64 lMin=limits< int64 >::min(), int64 lMax=limits< int64 >::max()) const =0
virtual RetCode isDouble(double *pd=nullptr, IMark *p=nullptr, double dMin=limits< double >::lowest(), double dMax=limits< double >::max()) const =0
virtual uint64 toULong(IMark *p=nullptr, uint64 uMin=0, uint64 uMax=limits< uint64 >::max()) const =0
virtual RetCode isUInt(uint32 *pu=nullptr, IMark *p=nullptr, uint32 uMin=0, uint32 uMax=limits< uint32 >::max()) const =0
virtual StringList getSkipList() const =0
Returns the original skip list parsed from the input line.
virtual RetCode isDVect(DVect *pv=nullptr, IMark *p=nullptr) const =0
virtual string getToken(IMark *p=nullptr) const =0
virtual RetCode isFilename(string *ps=nullptr, const string &def_ext={}, bool openForRead=false, IMark *p=nullptr) const =0
RetCode
Possible return codes for isXXX() functions.
Definition iparse.h:59
@ rcOK
token was interpreted successfully.
Definition iparse.h:60
@ rcRange
the token was interpreted correctly but it's value fell outside of a restricted range given.
Definition iparse.h:63
@ rcExtra
an extra unused token was found at the end of the command line.
Definition iparse.h:64
@ rcMiss
no token was present at that position.
Definition iparse.h:61
@ rcBad
the token could not be interepreted as asked.
Definition iparse.h:62
virtual IParse * createTemporaryParse(const string &)=0
A method to return a temporary IParse Object that must be deleted.
virtual DVect2 toDVect2(IMark *p=nullptr) const =0
virtual RetCode isSymTensor(SymTensor *pv=nullptr, IMark *p=nullptr) const =0
virtual void stripTokens(IMark *mBegin, IMark *mEnd, IMark *p=nullptr)=0
virtual RetCode isDVect3(DVect3 *pv=nullptr, IMark *p=nullptr) const =0
virtual IMark * createMark(int pos=0) const =0
virtual int isStringCharStart(char c) const =0
virtual bool checkSkipPost(StringList *skipList, char c, IMark *p=nullptr) const =0
virtual void checkError(RetCode rc, IMark *p=nullptr) const =0
virtual RetCode isString(string *ps=nullptr, IMark *p=nullptr, bool encodeBackslash=true) const =0
virtual int getTokenIndex(IMark *p=nullptr) const =0
virtual DVect3 toDVect3(IMark *p=nullptr) const =0
virtual void addSkipPre(StringList *skipList, char c, IMark *p=nullptr) const =0
Adds a character to the end of the skip string BEFORE the current token.
virtual IMark * createMarkCopy(IMark *p=nullptr) const =0
virtual RetCode isKeyword(const string &key, uint32 *pPos=nullptr, IMark *p=nullptr) const =0
virtual int toInt(IMark *p=nullptr, int iMin=limits< int >::min(), int iMax=limits< int >::max()) const =0
virtual RetCode isULong(uint64 *pu=nullptr, IMark *p=nullptr, uint64 uMin=0, uint64 uMax=limits< uint64 >::max()) const =0
virtual uint32 toKeyword(const StringList &key, IMark *p=nullptr) const =0
virtual bool findKeyword(const string &keyword, IMark *pFound, IMark *pStart=nullptr) const =0
virtual bool isHelp(IMark *p=nullptr) const =0
Returns TRUE if the token matches one of the help_tokens.
virtual ~IParse()
Virtual destructor.
Definition iparse.h:68
virtual bool activateHelp(bool b)=0
Turne help on/off.
virtual int isStringCharEnd(char c) const =0
virtual double toDouble(IMark *p=nullptr, double dMin=-limits< double >::max(), double dMax=limits< double >::max()) const =0
virtual bool isToken(IMark *p=nullptr) const =0
virtual void decrement(IMark *p=nullptr) const =0
Decrements the provided or internal mark.
Definition itextinput.h:41
Provides a interface for simple writing of text.
Definition itextoutput.h:13
debug checked shorthand for std::numeric_limits<T>::
Definition limit.h:25
DIM - Provides code portability between 2D and 3D codes.
DVect3 DVect
Vector of doubles, either 2D or 3D.
Definition dim.h:156
namespace Itasca
Definition basememory.cpp:14
IParse::RetCode isDAvect(const IParse &par, DAVect3 *v=nullptr, IParse::IMark *m=nullptr)
Thin wrapper for IParse::isDVect3, designed to make it easier to write code that is the same in 2D an...
Definition iparse.h:350
DAVect3 toDAVect(const IParse &par, IParse::IMark *m=nullptr)
Thin wrapper for IParse::toDVect3, designed to make it easier to write code that is the same in 2D an...
Definition iparse.h:354
DVect3 toDVect(const IParse &par, IParse::IMark *m=nullptr)
Thin wrapper for IParse::toDVect3, designed to make it easier to write code that is the same in 2D an...
Definition iparse.h:352
IParse::RetCode isDVect(const IParse &par, DVect3 *v=nullptr, IParse::IMark *m=nullptr)
Thin wrapper for IParse::isDVect3, designed to make it easier to write code that is the same in 2D an...
Definition iparse.h:348