104template <
typename LookupClass,
typename EnumType> DPUBLICCLASS
Enum :
public Git {
107 LookupClass lookupObject;
111 void SetValue(
const unsigned int i) {
112 if (i > lookupObject.GetMaxValue())
113 value = InvalidValue();
117 EnumType InvalidValue()
const {
118 return (EnumType)(lookupObject.GetMaxValue()+1);
128 value = InvalidValue();
136 Enum(EnumType InitialValue) : value(InitialValue) {}
149 const char *
const Name,
152 const char *Default=0,
154 value = InvalidValue();
155 Get(Id, Name, Position, status, Default, Flags);
174 const char *
const Name,
177 const char *Default=0,
181 GitArgGetS((SdsIdType)Id,Name,Position,
182 lookupObject.GetStringArray(),
184 Flags,
sizeof(
string),
string,&index,status);
189 operator EnumType()
const {
194 operator const char *()
const {
195 return lookupObject.GetStringArray()[int(value)];
228template <
long int MinVal,
233 virtual const double * Range() {
234 static const double range[] = { MinVal, MaxVal };
258 const char *
const Name,
260 StatusType *
const status,
261 const double Default = (
double)DefaultVal,
286template <
long int MinVal=LONG_MIN,
287 long int MaxVal=LONG_MAX,
288 long int DefaultVal=0> DPUBLICCLASS
Int :
public GitInt {
291 virtual const long int * Range() {
292 static const long int range[] = { MinVal, MaxVal };
316 const char *
const Name,
318 StatusType *
const status,
319 const long Default = DefaultVal,
321 GitInt::Get(Id,Name,Position,status,Default,Flags);
338 static const unsigned DefaultStringLength = 100;
348 String(
const std::string & str) : std::string(str) {}
357 String(
const std::string & str, size_type pos, size_type n=std::string::npos) :
358 std::string(str, pos, n) {}
363 String(
const char * s) : std::string(s) {}
369 String(
const char * s, size_type n) : std::string(s,n) {}
372 String(size_type n,
char c) : std::string(n,c) {}
378 template<
class InputIterator>
379 String(InputIterator beg, InputIterator end) : std::string(beg,end){}
393 const char *
const Name,
395 StatusType *
const status,
396 const char * Default = 0,
398 this->
Get(Id, Name, Position, status, Default, Flags);
407 this->std::string::operator=(str);
415 this->std::string::operator=(std::string(str));
424 this->std::string::operator=(s);
435 this->std::string::operator=(c);
453 const char *
const Name,
455 StatusType *
const status,
456 const char * Default = 0,
virtual void Get(const SdsId &Id, const char *const Name, const int Position, StatusType *const status, const long int Default=0, const int Flags=0)
Get the value of the object from an SDS struture.
Definition Git.h:756
A class which reads integer values from an SDS argument structure.
Definition Git.h:685
virtual void Get(const SdsId &Id, const char *const Name, const int Position, StatusType *const status, const double Default=0.0, const int Flags=0)
Get the value of the object from an SDS struture.
Definition Git.h:645
A class which reads real values from an SDS argument structure.
Definition Git.h:573
virtual unsigned int GetMaxValue() const =0
This function should return the maximum normal value of the enumerated value.
virtual const char ** GetStringArray() const =0
Return a pointer to an array of enum strings equivalents.
virtual ~EnumLookupClass()
Destructor.
Definition gittpl.h:79
A virtual base class for the lookup class template arguments to GitTpl::Enum.
Definition gittpl.h:55
Enum(const SdsId &Id, const char *const Name, const int Position, StatusType *status, const char *Default=0, const int Flags=Git::Upper|Git::Abbrev)
Constructor which contructs the values from an SDS type.
Definition gittpl.h:148
virtual ~Enum()
Destructor.
Definition gittpl.h:199
Enum(EnumType InitialValue)
Constructor with initial value supplied.
Definition gittpl.h:136
Enum()
Default contructor for the object.
Definition gittpl.h:127
void Get(const SdsId &Id, const char *const Name, const int Position, StatusType *status, const char *Default=0, const int Flags=Git::Upper|Git::Abbrev|Git::KeepErr)
Get the value of the object from an SDS struture.
Definition gittpl.h:173
A class which reads Enumerated values from a SDS argument structures.
Definition gittpl.h:104
Int(const long def=DefaultVal)
Simple constructor with a default value specified.
Definition gittpl.h:301
Int(const SdsId &Id, const char *const Name, const int Position, StatusType *const status, const long Default=DefaultVal, const int Flags=Git::KeepErr)
Constructor with the initial value set from an SDS structure.
Definition gittpl.h:314
A class which reads integer values from an SDS argument structure.
Definition gittpl.h:288
Real(const double def=(double) DefaultVal)
Simple constructor with a default value specified.
Definition gittpl.h:243
Real(const SdsId &Id, const char *const Name, const int Position, StatusType *const status, const double Default=(double) DefaultVal, const int Flags=Git::KeepErr)
Constructor with the initial value set from an SDS structure.
Definition gittpl.h:256
A class which reads real values from an SDS argument structure.
Definition gittpl.h:230
String & operator=(const char *s)
Copy contents of s into this string.
Definition gittpl.h:423
String(const std::string &str)
Create a Git::String from a std::string.
Definition gittpl.h:348
String(const char *s)
Create a Git::String from a C character array.
Definition gittpl.h:363
String(InputIterator beg, InputIterator end)
Create a Git::String that is initialised by all characters from beg to end.
Definition gittpl.h:379
String & operator=(char c)
Set value to string of length 1.
Definition gittpl.h:434
String(const char *s, size_type n)
Create a Git::String from the first n characters a C string.
Definition gittpl.h:369
void Get(const SdsId &Id, const char *const Name, const int Position, StatusType *const status, const char *Default=0, const int Flags=Git::KeepErr)
Fetch the value of this item from an SDS structure.
String(const SdsId &Id, const char *const Name, const int Position, StatusType *const status, const char *Default=0, const int Flags=Git::KeepErr)
Constructor with the initial value set from an SDS structure.
Definition gittpl.h:392
String & operator=(const std::string &str)
Assign str to this string.
Definition gittpl.h:406
String(size_type n, char c)
Create a Git::String intialised with n occurances of c.
Definition gittpl.h:372
String & operator=(const String &str)
Assign str to this string.
Definition gittpl.h:414
String()
Create an empty Git::String.
Definition gittpl.h:343
String(const std::string &str, size_type pos, size_type n=std::string::npos)
Create a Git::String from a std::string, initialised from s starting at index pos,...
Definition gittpl.h:357
A class which reads a a string item from an SDS structure.
Definition gittpl.h:335
@ Abbrev
Allow abbreviations
Definition Git.h:352
@ KeepErr
Keep error status on return
Definition Git.h:351
@ Upper
Convert strings to upper case.
Definition Git.h:349
The GitArgGet flags set up appropriately for C++.
Definition Git.h:346
A C++ Interface to the handling SDS structures.
Definition sds.h:761