I want to use a reserverd name, which is "const" in my enum.
public enum class EdsAttributeAccessType : int
{
ro,
rw,
wo,
const,
notSpecified
};
Is it possible to do this or just an illegal use? The reason why I am trying to do this is I am parsing a device description file where this appears. The easiest way is to parse the file's attribute like this.
File example:
...
[2F51sub2]
ParameterName=Program Number 2
ObjectType=0x07
DataType=0x0007
AccessType=rw
DefaultValue=0x0
PDOMapping=0
[2F59]
SubNumber=3
ParameterName=Download Timeout Indicator
ObjectType=0x08
[2F59sub0]
ParameterName=Number of Entries
ObjectType=0x07
DataType=0x0005
AccessType=const
PDOMapping=0
...
Then I just have to do this:
EdsNodeAttribute^ result = FindAttribute(EdsAttributeType::AccessType);
if (result != nullptr){
return (EdsAttributeAccessType)Enum::Parse(EdsAttributeAccessType::typeid, result->Value, true);
}