Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 30, 2011, 9:31:05 PM (13 years ago)
Author:
landauf
Message:

fixed bug with multiple lines in shell.
adjusted colors in IOConsole and InGameConsole a bit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/output/src/libraries/util/StringUtils.cc

    r8232 r8801  
    7979        for (; pos2 > 0         && (str[pos2] == ' ' || str[pos2] == '\t' || str[pos2] == '\n'); pos2--);
    8080        return str.substr(pos1, pos2 - pos1 + 1);
     81    }
     82
     83    /// Splits a given string by a delimiter and stores it in an output vector
     84    void vectorize(const std::string& str, char delimiter, std::vector<std::string>* output)
     85    {
     86        for (size_t start = 0, end = 0; end != std::string::npos; start = end + 1)
     87        {
     88            end = str.find_first_of(delimiter, start);
     89            output->push_back(str.substr(start, end - start));
     90        }
    8191    }
    8292
     
    517527        return matrix[(rows-1)*cols + cols-1];
    518528    }
    519    
     529
    520530    /**
    521531    @brief
Note: See TracChangeset for help on using the changeset viewer.