I often find myself needing to write functions to load/save from/to ASCII (or similar) text files; such as config files or data. I can and have done so many times but never feel like I do it well. ie the results are not very tolerant of minor changes to the file format.
Can anyone point me to a good guide to writing robust开发者_开发技巧 text file io or even better some libraries to make it easier?
Off the top of my head, there's:
- Glib's key-value file parser
- YAML
Both of these are pretty standard under linux.
YAML is a really good choice. Here we use yaml-cpp
my2c
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论