This source file includes following definitions.
- is_symbolic_link
- async_
- async_
- async_
- async_
- async_
- Initialize
#include "base/files/file.h"
#include "base/platform_file.h"
namespace base {
File::Info::Info()
: size(0),
is_directory(false),
is_symbolic_link(false) {
}
File::Info::~Info() {
}
File::File()
: file_(kInvalidPlatformFileValue),
error_details_(FILE_ERROR_FAILED),
created_(false),
async_(false) {
}
#if !defined(OS_NACL)
File::File(const FilePath& name, uint32 flags)
: file_(kInvalidPlatformFileValue),
error_details_(FILE_OK),
created_(false),
async_(false) {
Initialize(name, flags);
}
#endif
File::File(PlatformFile platform_file)
: file_(platform_file),
error_details_(FILE_OK),
created_(false),
async_(false) {
#if defined(OS_POSIX)
DCHECK_GE(platform_file, -1);
#endif
}
File::File(Error error_details)
: file_(kInvalidPlatformFileValue),
error_details_(error_details),
created_(false),
async_(false) {
}
File::File(RValue other)
: file_(other.object->TakePlatformFile()),
error_details_(other.object->error_details()),
created_(other.object->created()),
async_(other.object->async_) {
}
File::~File() {
}
File& File::operator=(RValue other) {
if (this != other.object) {
Close();
SetPlatformFile(other.object->TakePlatformFile());
error_details_ = other.object->error_details();
created_ = other.object->created();
async_ = other.object->async_;
}
return *this;
}
#if !defined(OS_NACL)
void File::Initialize(const FilePath& name, uint32 flags) {
if (name.ReferencesParent()) {
error_details_ = FILE_ERROR_ACCESS_DENIED;
return;
}
InitializeUnsafe(name, flags);
}
#endif
}