OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_SCOPED_HANDLE_H_ | 5 #ifndef BASE_SCOPED_HANDLE_H_ |
6 #define BASE_SCOPED_HANDLE_H_ | 6 #define BASE_SCOPED_HANDLE_H_ |
7 | 7 |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 | 11 |
12 #if defined(OS_WIN) | 12 #if defined(OS_WIN) |
13 #include "base/scoped_handle_win.h" | 13 #include "base/scoped_handle_win.h" |
14 #elif defined(OS_LINUX) | 14 #elif defined(OS_POSIX) && !defined(OS_MACOSX) |
15 #include "base/scoped_handle_gtk.h" | 15 #include "base/scoped_handle_gtk.h" |
16 #endif | 16 #endif |
17 | 17 |
18 class ScopedStdioHandle { | 18 class ScopedStdioHandle { |
19 public: | 19 public: |
20 ScopedStdioHandle() | 20 ScopedStdioHandle() |
21 : handle_(NULL) { } | 21 : handle_(NULL) { } |
22 | 22 |
23 explicit ScopedStdioHandle(FILE* handle) | 23 explicit ScopedStdioHandle(FILE* handle) |
24 : handle_(handle) { } | 24 : handle_(handle) { } |
(...skipping 22 matching lines...) Expand all Loading... |
47 handle_ = newhandle; | 47 handle_ = newhandle; |
48 } | 48 } |
49 | 49 |
50 private: | 50 private: |
51 FILE* handle_; | 51 FILE* handle_; |
52 | 52 |
53 DISALLOW_EVIL_CONSTRUCTORS(ScopedStdioHandle); | 53 DISALLOW_EVIL_CONSTRUCTORS(ScopedStdioHandle); |
54 }; | 54 }; |
55 | 55 |
56 #endif // BASE_SCOPED_HANDLE_H_ | 56 #endif // BASE_SCOPED_HANDLE_H_ |
OLD | NEW |