| 58 | //----------------------------------------------------------------------------- |
| 59 | |
| 60 | bool TamlJSONWriter::write( FileStream& stream, const TamlWriteNode* pTamlWriteNode ) |
| 61 | { |
| 62 | // Debug Profiling. |
| 63 | PROFILE_SCOPE(TamlJSONWriter_Write); |
| 64 | |
| 65 | // Create document. |
| 66 | rapidjson::Document document; |
| 67 | document.SetObject(); |
| 68 | |
| 69 | // Compile the root type. |
| 70 | rapidjson::Value rootValue(rapidjson::kObjectType); |
| 71 | compileType( document, &rootValue, NULL, pTamlWriteNode, -1 ); |
| 72 | |
| 73 | // Write document to stream. |
| 74 | rapidjson::PrettyWriter<FileStream> jsonStreamWriter( stream ); |
| 75 | document.Accept( jsonStreamWriter ); |
| 76 | |
| 77 | return true; |
| 78 | } |
| 79 | |
| 80 | //----------------------------------------------------------------------------- |
| 81 | |