Merge pull request #38 from dhickin/getSubField_overload

Add char* overload for non-template getSubField
This commit is contained in:
dhickin
2016-07-05 15:18:46 +01:00
committed by GitHub
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.