Logo Search packages:      
Sourcecode: inkscape version File versions

String buildtool::MakeBase::leftJustify ( const String &  s  )  [protected, inherited]

remove leading whitespace from each line

Definition at line 3320 of file buildtool.cpp.

{
    String out;
    int len = s.size();
    for (int i = 0 ; i<len ; )
        {
        char ch;
        //Skip to first visible character
        while (i<len)
            {
            ch = s[i];
            if (ch == '\n' || ch == '\r'
              || !isspace(ch))
                  break;
            i++;
            }
        //Copy the rest of the line
        while (i<len)
            {
            ch = s[i];
            if (ch == '\n' || ch == '\r')
                {
                if (ch != '\r')
                    out.push_back('\n');
                i++;
                break;
                }
            else
                {
                out.push_back(ch);
                }
            i++;
            }
        }
    return out;
}


Generated by  Doxygen 1.6.0   Back to index