allow querying for first field in hasField()

This commit is contained in:
john30
2015-10-18 12:08:28 +02:00
parent d7f54f97f4
commit f02eee616a
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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
View File
@@ -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.
*/ */