Logo Search packages:      
Sourcecode: qt4-x11 version File versions

QString QDir::toNativeSeparators ( const QString pathName  )  [static]

Returns pathName with the '/' separators converted to separators that are appropriate for the underlying operating system.

On Windows, toNativeSeparators("c:/winnt/system32") returns "c:\\winnt\\system32".

The returned string may be the same as the argument on some operating systems, for example on Unix.

See also:
fromNativeSeparators(), separator()

Definition at line 878 of file qdir.cpp.

References QString::length().

Referenced by QCompleter::splitPath(), and QFSCompletor::splitPath().

    QString n(pathName);
#if defined(Q_FS_FAT) || defined(Q_OS_OS2EMX)
    for (int i=0; i<(int)n.length(); i++) {
        if (n[i] == QLatin1Char('/'))
            n[i] = QLatin1Char('\\');
    return n;

Generated by  Doxygen 1.6.0   Back to index