| 155 | } |
| 156 | |
| 157 | XnStatus loadModulesFile(TiXmlDocument& doc) |
| 158 | { |
| 159 | XnStatus nRetVal = XN_STATUS_OK; |
| 160 | |
| 161 | XnChar strFileName[XN_FILE_MAX_PATH]; |
| 162 | |
| 163 | nRetVal = resolveModulesFile(strFileName, XN_FILE_MAX_PATH); |
| 164 | XN_IS_STATUS_OK(nRetVal); |
| 165 | |
| 166 | XnBool bDoesExist = FALSE; |
| 167 | nRetVal = xnOSDoesFileExist(strFileName, &bDoesExist); |
| 168 | XN_IS_STATUS_OK(nRetVal); |
| 169 | |
| 170 | if (bDoesExist) |
| 171 | { |
| 172 | nRetVal = xnXmlLoadDocument(doc, strFileName); |
| 173 | XN_IS_STATUS_OK(nRetVal); |
| 174 | } |
| 175 | else |
| 176 | { |
| 177 | TiXmlElement root("Modules"); |
| 178 | doc.InsertEndChild(root); |
| 179 | doc.SaveFile(strFileName); |
| 180 | } |
| 181 | |
| 182 | return (XN_STATUS_OK); |
| 183 | } |
| 184 | |
| 185 | XnStatus saveModulesFile(TiXmlDocument& doc) |
| 186 | { |
no test coverage detected