//
-// Open Service Platform
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the License);
/**
* @class FileAttributes
- * @brief This class provides a collection of basic file attributes.
+ * @brief This class provides methods for file attributes.
*
* @since 2.0
*
File file;
FileAttributes attr;
long long size;
- DateTime dtCreate ;
- DateTime dtModified ;
+ DateTime modifiedTime;
result r = E_SUCCESS;
r = File::GetAttributes(App::GetInstance()->GetAppDataPath() + fileName, attr);
}
size = attr.GetFileSize();
- AppLog("* size=%d", size);
-
- dtCreate = attr.GetDateTime();
- AppLog("* creation time: %d year, %d month, %d day, %d hour, %d min, %d sec.\n",
- dtCreate.GetYear(),
- dtCreate.GetMonth(),
- dtCreate.GetDay(),
- dtCreate.GetHour(),
- dtCreate.GetMinute(),
- dtCreate.GetSecond()
- );
-
- dtModified = attr.GetLastModifiedTime();
- AppLog("* last modified time: %d year, %d month, %d day, %d hour, %d min, %d sec.\n",
- dtModified.GetYear(),
- dtModified.GetMonth(),
- dtModified.GetDay(),
- dtModified.GetHour(),
- dtModified.GetMinute(),
- dtModified.GetSecond()
+ AppLog("File size: %d", size);
+
+ modifiedTime = attr.GetLastModifiedTime();
+ AppLog("Last modified time: %d year, %d month, %d day, %d hour, %d min, %d sec.\n",
+ modifiedTime.GetYear(),
+ modifiedTime.GetMonth(),
+ modifiedTime.GetDay(),
+ modifiedTime.GetHour(),
+ modifiedTime.GetMinute(),
+ modifiedTime.GetSecond()
);
if (attr.IsDirectory())
{
- AppLog("* This is a directory.");
+ AppLog("This is a directory.");
}
if (attr.IsHidden())
{
- AppLog("* This is a hidden file.");
- }
- if (attr.IsReadOnly())
- {
- AppLog("* This is a read-only file.");
+ AppLog("This is a hidden file.");
}
- AppLog("Succeeded!");
+ AppLog("Succeeded");
return 0;
CATCH:
- AppLog("Failed...");
+ AppLog("Failed");
return -1;
}
* @endcode
FileAttributes(const FileAttributes& rhs);
/**
- * Assigns the value of the specified instance to the current instance of %FileAttributes.
+ * Assigns the specified value of the specified instance to the current instance of %FileAttributes.
*
* @since 2.0
*
FileAttributes& operator =(const FileAttributes& rhs);
/**
- * Compares the specified instance of Object to the calling instance of %FileAttributes.
+ * Compares the specified instance of Tizen::Base::Object to the current instance of %FileAttributes.
*
* @since 2.0
*
bool IsReadOnly(void) const;
/**
- * Gets the date and time of the file creation or last modification.
+ * Gets the date and time of the last modification to the file.
*
* @since 2.0
*
- * @return The date and time of the file creation or last modification
- * @remarks If the created file is modified, its date and time is updated.
+ * @return The date and time of the last modification to the file
*/
Tizen::Base::DateTime GetDateTime(void) const;