OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license | |
5 * that can be found in the LICENSE file in the root of the source | |
6 * tree. An additional intellectual property rights grant can be found | |
7 * in the file PATENTS. All contributing project authors may | |
8 * be found in the AUTHORS file in the root of the source tree. | |
9 */ | |
10 | |
11 #include "webrtc/base/file.h" | |
12 | |
13 namespace rtc { | |
14 | |
15 File::File(PlatformFile file) : file_(file) {} | |
16 | |
17 File::~File() { | |
18 Close(); | |
19 } | |
20 | |
21 File::File(File&& other) : file_(other.file_) { | |
22 other.file_ = kInvalidPlatformFileValue; | |
23 } | |
24 | |
25 File& File::operator=(File&& other) { | |
26 Close(); | |
27 file_ = other.file_; | |
28 other.file_ = kInvalidPlatformFileValue; | |
29 return *this; | |
30 } | |
31 | |
32 bool File::IsOpen() { | |
33 return file_ != kInvalidPlatformFileValue; | |
34 } | |
35 | |
36 } // namespace rtc | |
OLD | NEW |