Add char* overload for non-template getSubField

This commit is contained in:
Dave Hickin
2016-07-04 14:59:56 +01:00
parent e5b6a88551
commit 028076e79c
2 changed files with 8 additions and 3 deletions

View File

@@ -104,9 +104,9 @@ const PVFieldPtrArray & PVStructure::getPVFields() const
return pvFields;
}
PVFieldPtr PVStructure::getSubField(string const &fieldName) const
PVFieldPtr PVStructure::getSubField(const char * fieldName) const
{
PVField * field = getSubFieldImpl(fieldName.c_str(), false);
PVField * field = getSubFieldImpl(fieldName, false);
if (field)
return field->shared_from_this();
else

View File

@@ -702,7 +702,12 @@ public:
* @param fieldName The name of the field.
* @return Pointer to the field or null if field does not exist.
*/
PVFieldPtr getSubField(std::string const &fieldName) const;
FORCE_INLINE PVFieldPtr getSubField(std::string const &fieldName) const
{
return getSubField(fieldName.c_str());
}
PVFieldPtr getSubField(const char *fieldName) const;
/**
* Get a subfield with the specified name.