4 #ifndef tools_get_lines
5 #define tools_get_lines
14 inline void get_lines(
const std::string& a_string,std::vector<std::string>& a_lines){
20 size_t length = a_string.length();
22 char* cstring =
str_dup(a_string.c_str());
26 for(
size_t count=0;count<length;count++) {
27 if( (cstring[count]==
'\n') ||
28 (cstring[count]==
'\0') ||
29 ( (cstring[count]==
'\\') && (cstring[count+1]==
'n') ) ) {
30 char shift_one = (cstring[count]==
'\n' ? 1 : 0);
31 cstring[count] =
'\0';
32 a_lines.push_back(cstring+pos);