allow querying for first field in hasField()
This commit is contained in:
@@ -571,7 +571,7 @@ result_t StringDataField::derive(string name, string comment,
|
|||||||
|
|
||||||
bool StringDataField::hasField(const char* fieldName, bool numeric)
|
bool StringDataField::hasField(const char* fieldName, bool numeric)
|
||||||
{
|
{
|
||||||
return !numeric && fieldName==m_name;
|
return !numeric && (fieldName==NULL || fieldName==m_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void StringDataField::dump(ostream& output)
|
void StringDataField::dump(ostream& output)
|
||||||
@@ -841,7 +841,7 @@ bool NumericDataField::hasFullByteOffset(bool after)
|
|||||||
|
|
||||||
bool NumericDataField::hasField(const char* fieldName, bool numeric)
|
bool NumericDataField::hasField(const char* fieldName, bool numeric)
|
||||||
{
|
{
|
||||||
return numeric && fieldName==m_name;
|
return numeric && (fieldName==NULL || fieldName==m_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NumericDataField::dump(ostream& output)
|
void NumericDataField::dump(ostream& output)
|
||||||
|
|||||||
+1
-1
@@ -225,7 +225,7 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return whether the field is available.
|
* Return whether the field is available.
|
||||||
* @param fieldName the name of the field to find.
|
* @param fieldName the name of the field to find, or NULL for any.
|
||||||
* @param numeric true for a numeric field, false for a string field.
|
* @param numeric true for a numeric field, false for a string field.
|
||||||
* @return true if the field is available.
|
* @return true if the field is available.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user