Skip to content

Commit 6ad1a3a

Browse files
committed
Add Metadata (from/to string) methods into Manager
1 parent a272622 commit 6ad1a3a

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

cpp/src/Manager.cpp

+19
Original file line numberDiff line numberDiff line change
@@ -4821,6 +4821,25 @@ if (Driver* driver = GetDriver(_homeId))
48214821
return "";
48224822
}
48234823

4824+
//-----------------------------------------------------------------------------
4825+
// <Manager::GetMetaDataId>
4826+
// Retrieve metadata from its name
4827+
//-----------------------------------------------------------------------------
4828+
Node::MetaDataFields Manager::GetMetaDataId(const string& metaDataFiledtoParse)
4829+
{
4830+
return Node::GetMetaDataId(metaDataFiledtoParse);
4831+
}
4832+
4833+
4834+
//-----------------------------------------------------------------------------
4835+
// <Manager::GetMetaDataString>
4836+
// Get the MetaData string representation
4837+
//-----------------------------------------------------------------------------
4838+
string const Manager::GetMetaDataString(Node::MetaDataFields metaData)
4839+
{
4840+
return Node::GetMetaDataString(metaData);
4841+
}
4842+
48244843
//-----------------------------------------------------------------------------
48254844
// <Manager::GetChangeLog>
48264845
// Retrieve ChangeLog of a Configuration File about a Node.

cpp/src/Manager.h

+12
Original file line numberDiff line numberDiff line change
@@ -2645,6 +2645,18 @@ namespace OpenZWave
26452645
* \return a string containing the requested metadata
26462646
*/
26472647
string const GetMetaData(uint32 const _homeId, uint8 const _nodeId, Node::MetaDataFields _metadata);
2648+
/**
2649+
* \brief Retrieve metadata from its name
2650+
* \param metaDataFiledtoParse the string to parse (careful, case sensitive)
2651+
* \return the found metaDataField if parsing is successful, or MetaData_Invalid
2652+
*/
2653+
Node::MetaDataFields GetMetaDataId(const string & metaDataFiledtoParse);
2654+
/**
2655+
* \brief Get the MetaData string representation
2656+
* \param metaData the metaData enum
2657+
* \return the metaData name (or empty string if not found)
2658+
*/
2659+
string const GetMetaDataString(Node::MetaDataFields metaData);
26482660
/**
26492661
* \brief Retrieve ChangeLogs about a configuration revision
26502662
* \param _homeId The Home ID of the driver for the node

0 commit comments

Comments
 (0)