----------------------------------------------------------------------------- Load the Config File Revision from each config file specified in our ManufacturerSpecific.xml file -----------------------------------------------------------------------------
| 97 | // ManufacturerSpecific.xml file |
| 98 | //----------------------------------------------------------------------------- |
| 99 | void ManufacturerSpecificDB::LoadConfigFileRevision |
| 100 | ( |
| 101 | ProductDescriptor *product |
| 102 | ) |
| 103 | { |
| 104 | // Parse the Z-Wave manufacturer and product XML file. |
| 105 | string configPath; |
| 106 | Options::Get()->GetOptionAsString( "ConfigPath", &configPath ); |
| 107 | |
| 108 | if (product->GetConfigPath().size() > 0) { |
| 109 | string path = configPath + product->GetConfigPath(); |
| 110 | |
| 111 | TiXmlDocument* pDoc = new TiXmlDocument(); |
| 112 | if( !pDoc->LoadFile( path.c_str(), TIXML_ENCODING_UTF8 ) ) |
| 113 | { |
| 114 | delete pDoc; |
| 115 | Log::Write( LogLevel_Info, "Unable to load config file %s", path.c_str() ); |
| 116 | return; |
| 117 | } |
| 118 | pDoc->SetUserData((void *)path.c_str()); |
| 119 | TiXmlElement const* root = pDoc->RootElement(); |
| 120 | char const *str = root->Value(); |
| 121 | if( str && !strcmp( str, "Product" ) ) |
| 122 | { |
| 123 | // Read in the revision attributes |
| 124 | str = root->Attribute( "Revision" ); |
| 125 | if( !str ) |
| 126 | { |
| 127 | Log::Write( LogLevel_Info, "Error in Product Config file at line %d - missing Revision attribute", root->Row() ); |
| 128 | delete pDoc; |
| 129 | return; |
| 130 | } |
| 131 | product->SetConfigRevision(atol(str)); |
| 132 | } |
| 133 | delete pDoc; |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | |
| 138 | //----------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected