Subversion Repositories HomeAutomation

Rev

Rev 969 | Rev 981 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 969 Rev 976
Line 328... Line 328...
328
 
328
 
329
    for (int n = 0; n < in.length(); n++)
329
    for (int n = 0; n < in.length(); n++)
330
    {
330
    {
331
        switch (in[n])
331
        switch (in[n])
332
        {
332
        {
-
 
333
            case '\r':
-
 
334
                break;
-
 
335
 
333
            case '\n':
336
            case '\n':
334
                out += "\\n";
337
                out += "\\n";
335
                break;
338
                break;
-
 
339
 
-
 
340
            case '\'':
-
 
341
                out += "\\'";
-
 
342
                break;
-
 
343
 
-
 
344
            case '"':
-
 
345
                out += "\\\"";
-
 
346
                break;
336
 
347
 
337
            default:
348
            default:
338
                out += in[n];
349
                out += in[n];
339
                break;
350
                break;
340
        }
351
        }
341
    }
352
    }
342
 
353
 
343
    return out;
354
    return out;
344
}
355
}
-
 
356
 
-
 
357
string rpad(string in, int length, char c)
-
 
358
{
-
 
359
    while (in.length() < length)
-
 
360
    {
-
 
361
        in += c;
-
 
362
    }
-
 
363
 
-
 
364
    return in;
-
 
365
}
-
 
366
 
-
 
367
string lpad(string in, int length, char c)
-
 
368
{
-
 
369
    while (in.length() < length)
-
 
370
    {
-
 
371
        in = c + in;
-
 
372
    }
-
 
373
 
-
 
374
    return in;
-
 
375
}
-
 
376
 
345
 
377
 
346
// FileTools
378
// FileTools
347
 
379
 
348
vector<string> FileTools::GetDirList(string path)
380
vector<string> FileTools::GetDirList(string path)
349
{
381
{