| 193 | } |
| 194 | |
| 195 | bool appendToFile(const std::string &fileName, const std::string &s) |
| 196 | { |
| 197 | std::ofstream outFile; |
| 198 | bool newline = false; |
| 199 | |
| 200 | if(getFileSize(fileName) > 0) { |
| 201 | newline = true; |
| 202 | } |
| 203 | |
| 204 | outFile.open(fileName.c_str(), std::ios::app); |
| 205 | |
| 206 | if(!outFile.is_open()) { |
| 207 | return false; |
| 208 | } |
| 209 | |
| 210 | // Add newline following previous line |
| 211 | if(newline) { |
| 212 | outFile << std::endl; |
| 213 | } |
| 214 | |
| 215 | outFile << s; |
| 216 | |
| 217 | return true; |
| 218 | } |
| 219 | |
| 220 | std::string format(const char *formatStr, double value) |
| 221 | { |
no test coverage detected