Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 21, 2008, 12:36:23 AM (16 years ago)
Author:
rgrieder
Message:

Applied long created patch that removes plugins.cfg and puts the content into orxonox.ini
This also allows to specify the media path for each 'distribution' individually because orxonox.ini has been added to the default files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/buildsystem/src/util/String.cc

    r1830 r2244  
    485485    return std::string::npos;
    486486}
     487
     488/**
     489    @brief Converts a path string to windows with "\" instead of "/".
     490    @param str String pointer to be manipulated
     491*/
     492void convertToWindowsPath(std::string* str)
     493{
     494    std::string& path = *str;
     495    // replace all occurences of "/" with "\"
     496    for (unsigned int i = 0; i < path.length(); ++i)
     497    {
     498        if (path[i] == '/')
     499            path[i] = '\\';
     500    }
     501    // add an extra '\\' at the end to make it a complete path
     502    if (path != "" && path[path.length() - 1] != '\\')
     503        path.append("\\");
     504}
     505
     506/**
     507    @brief Converts a path string to unix with "/" instead of "\".
     508    @param str String pointer to be manipulated
     509*/
     510void convertToUnixPath(std::string* str)
     511{
     512    std::string& path = *str;
     513    // replace all occurences of "\" with "/"
     514    for (unsigned int i = 0; i < path.length(); ++i)
     515    {
     516        if (path[i] == '\\')
     517            path[i] = '/';
     518    }
     519    // add an extra '\\' at the end to make it a complete path
     520    if (path != "" && path[path.length() - 1] != '/')
     521        path.append("/");
     522}
Note: See TracChangeset for help on using the changeset viewer.