Hi Devs,<br><br>Upon implementing a visual mapfile editor, I&#39;m about to establish a support for instant visualizing the corresponding mapfile fragments for the mapscript object (for the layerObj especially). This effort would involve writing the mapfile fragments to strings something like the reverse of the msUpdateXXXFromString functions.<br>
<br>So as to implement such an option we should probably rely on the existing serializer functions like writeLayer, writeClass etc. but those functions are writing the results to a FILE* streams instead of strings or memory buffers.<br>
<br>I&#39;d be curious to know whether we&#39;d have a simple workaround to redirect those streams into strings like using the following option when implementing a hypothetic writeLayerToString function:<br><br><br>1. Replace fprintf-s with msIO_fprintf-s in writeLayer<br>
2. Add writLayerToString to the mapscript API. In writLayerToString Call msIO_installStdoutToBuffer before calling writeLayer return the IOContext&#39;s cbData as string.<br><br><br>Or alternatively we could just implement a duplicate of writeLayer to use sprintf-s instead of fprintf-s (?)<br>
<br><br>Let me know about your thoughts in this topic whether it&#39;s reasonable or not?<br><br><br><br>Best regards,<br><br>Tamas<br><br>