| 72 | |
| 73 | |
| 74 | void PropertyFileConfiguration::save(std::ostream& ostr) const |
| 75 | { |
| 76 | MapConfiguration::iterator it = begin(); |
| 77 | MapConfiguration::iterator ed = end(); |
| 78 | while (it != ed) |
| 79 | { |
| 80 | ostr << it->first << ": "; |
| 81 | for (std::string::const_iterator its = it->second.begin(); its != it->second.end(); ++its) |
| 82 | { |
| 83 | switch (*its) |
| 84 | { |
| 85 | case '\t': |
| 86 | ostr << "\\t"; |
| 87 | break; |
| 88 | case '\r': |
| 89 | ostr << "\\r"; |
| 90 | break; |
| 91 | case '\n': |
| 92 | ostr << "\\n"; |
| 93 | break; |
| 94 | case '\f': |
| 95 | ostr << "\\f"; |
| 96 | break; |
| 97 | case '\\': |
| 98 | ostr << "\\\\"; |
| 99 | break; |
| 100 | default: |
| 101 | ostr << *its; |
| 102 | break; |
| 103 | } |
| 104 | } |
| 105 | ostr << "\n"; |
| 106 | ++it; |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | |
| 111 | void PropertyFileConfiguration::save(const std::string& path) const |