extendd getName with optional field index

This commit is contained in:
john30
2017-01-08 12:07:11 +01:00
parent 42a5d1d0c3
commit 41ac7a5591
2 changed files with 26 additions and 5 deletions
+7 -3
View File
@@ -128,10 +128,11 @@ public:
vector<SingleDataField*>& fields) = 0;
/**
* Get the field name.
* @return the field name.
* Get the specified field name.
* @param fieldIndex the index of the field, or -1 for this.
* @return the field name, or the index as string if not unique or not available.
*/
string getName() const { return m_name; }
virtual string getName(signed char fieldIndex=-1) const { return m_name; }
/**
* Get the field comment.
@@ -549,6 +550,9 @@ public:
// @copydoc
virtual unsigned char getLength(PartType partType, unsigned char maxLength=MAX_LEN);
// @copydoc
virtual string getName(signed char fieldIndex=-1);
// @copydoc
virtual result_t derive(string name, string comment,
string unit, const PartType partType,