aboutsummaryrefslogtreecommitdiff
path: root/backends/fs/symbian/symbian-fs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backends/fs/symbian/symbian-fs.cpp')
-rw-r--r--backends/fs/symbian/symbian-fs.cpp50
1 files changed, 25 insertions, 25 deletions
diff --git a/backends/fs/symbian/symbian-fs.cpp b/backends/fs/symbian/symbian-fs.cpp
index 90d7bb48d4..d4c4513d90 100644
--- a/backends/fs/symbian/symbian-fs.cpp
+++ b/backends/fs/symbian/symbian-fs.cpp
@@ -22,7 +22,7 @@
* $Id$
*/
-#if defined (__SYMBIAN32__)
+#if defined (__SYMBIAN32__)
#include "backends/fs/abstract-fs.h"
#include <dirent.h>
@@ -32,7 +32,7 @@
/**
* Implementation of the ScummVM file system API based on POSIX.
- *
+ *
* Parts of this class are documented in the base interface class, AbstractFilesystemNode.
*/
class SymbianFilesystemNode : public AbstractFilesystemNode {
@@ -46,19 +46,19 @@ protected:
public:
/**
* Creates a SymbianFilesystemNode with the root node as path.
- *
+ *
* @param aIsRoot true if the node will be a pseudo root, false otherwise.
*/
SymbianFilesystemNode(bool aIsRoot);
-
+
/**
* Creates a SymbianFilesystemNode for a given path.
- *
+ *
* @param path String with the path the new node should point to.
*/
SymbianFilesystemNode(const String &path);
-
- virtual bool exists() const {
+
+ virtual bool exists() const {
TFileName fname;
TPtrC8 ptr((const unsigned char*)_path.c_str(),_path.size());
fname.Copy(ptr);
@@ -79,18 +79,18 @@ public:
/**
* Returns the last component of a given path.
- *
+ *
* Examples:
* c:\foo\bar.txt would return "\bar.txt"
* c:\foo\bar\ would return "\bar\"
- *
+ *
* @param str Path to obtain the last component from.
* @return Pointer to the first char of the last component inside str.
*/
const char *lastPathComponent(const Common::String &str) {
if(str.empty())
return "";
-
+
const char *start = str.c_str();
const char *cur = start + str.size() - 2;
@@ -103,14 +103,14 @@ const char *lastPathComponent(const Common::String &str) {
/**
* Fixes the path by changing all slashes to backslashes.
- *
+ *
* @param path String with the path to be fixed.
*/
static void fixFilePath(Common::String& path) {
TInt len = path.size();
-
+
for (TInt index = 0; index < len; index++) {
- if (path[index] == '/') {
+ if (path[index] == '/') {
path[index] = '\\';
}
}
@@ -132,7 +132,7 @@ SymbianFilesystemNode::SymbianFilesystemNode(const String &path) {
_isPseudoRoot = false;
_path = path;
-
+
fixFilePath(_path);
_displayName = lastPathComponent(_path);
@@ -184,27 +184,27 @@ bool SymbianFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, b
TVolumeInfo volumeInfo;
TBuf8<30> driveLabel8;
TBuf8<30> driveString8;
-
+
for (driveNumber=EDriveA; driveNumber<=EDriveZ; driveNumber++) {
TInt err = fs.Volume(volumeInfo, driveNumber);
if (err != KErrNone)
- continue;
+ continue;
if (fs.DriveToChar(driveNumber,driveLetter) != KErrNone)
continue;
driveLetterValue = driveLetter;
- if (volumeInfo.iName.Length() > 0) {
+ if (volumeInfo.iName.Length() > 0) {
driveLabel8.Copy(volumeInfo.iName); // 16 to 8bit des // enabling this line alone gives KERN-EXEC 3 with non-optimized GCC? WHY? grrr
driveString8.Format(_L8("Drive %c: (%S)"), driveLetterValue, &driveLabel8);
} else {
driveString8.Format(_L8("Drive %c:"), driveLetterValue);
}
-
+
char path[10];
sprintf(path,"%c:\\", driveNumber+'A');
-
- SymbianFilesystemNode entry(false);
+
+ SymbianFilesystemNode entry(false);
entry._displayName = (char*)driveString8.PtrZ(); // drive_name
entry._isDirectory = true;
entry._isValid = true;
@@ -226,17 +226,17 @@ bool SymbianFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, b
nameBuf.Copy(fileentry.iName);
SymbianFilesystemNode entry(false);
entry._isPseudoRoot = false;
-
+
entry._displayName =(char*)nameBuf.PtrZ();
entry._path = _path;
entry._path +=(char*)nameBuf.PtrZ();
entry._isDirectory = fileentry.IsDir();
-
+
// Honor the chosen mode
if ((mode == FilesystemNode::kListFilesOnly && entry._isDirectory) ||
(mode == FilesystemNode::kListDirectoriesOnly && !entry._isDirectory))
continue;
-
+
if (entry._isDirectory)
entry._path += "\\";
myList.push_back(new SymbianFilesystemNode(entry));
@@ -244,7 +244,7 @@ bool SymbianFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, b
CleanupStack::PopAndDestroy(dirPtr);
}
}
-
+
return true;
}
@@ -267,7 +267,7 @@ AbstractFilesystemNode *SymbianFilesystemNode::getParent() const {
{
p = new SymbianFilesystemNode(true);
}
-
+
return p;
}