----------------------------------------------------------------------------- Get true if file saves successfully. -----------------------------------------------------------------------------
| 125 | // Get true if file saves successfully. |
| 126 | // ----------------------------------------------------------------------------- |
| 127 | S32 SimXMLDocument::saveFile(const char* rFileName) |
| 128 | { |
| 129 | char buffer[1024]; |
| 130 | Con::expandPath(buffer, sizeof(buffer), rFileName); |
| 131 | |
| 132 | if(*buffer == 0) |
| 133 | return false; |
| 134 | |
| 135 | FileStream strm; |
| 136 | if(!ResourceManager->openFileForWrite(strm, buffer, FileStream::Write)) |
| 137 | { |
| 138 | Con::errorf(ConsoleLogEntry::General, "Unable to open file '%s for writing.", buffer); |
| 139 | return false; |
| 140 | } |
| 141 | |
| 142 | bool retVal = m_qDocument->SaveFile(strm);//m_qDocument->SaveFile( buffer ); |
| 143 | |
| 144 | // close the stream |
| 145 | strm.close(); |
| 146 | |
| 147 | return retVal; |
| 148 | } |
| 149 | |
| 150 | // ----------------------------------------------------------------------------- |
| 151 | // Get true if XML text parses correctly. |
no test coverage detected