| 43 | }; |
| 44 | |
| 45 | struct auto_dir : private noncopyable { |
| 46 | auto_dir() : dp(0) { } |
| 47 | ~auto_dir() { |
| 48 | reset(); |
| 49 | } |
| 50 | DIR *get() const { return dp; } |
| 51 | void reset(DIR *d = 0) { |
| 52 | if (dp != 0) { |
| 53 | closedir(dp); |
| 54 | } |
| 55 | dp = d; |
| 56 | } |
| 57 | private: |
| 58 | DIR *dp; |
| 59 | }; |
| 60 | |
| 61 | }; |
| 62 |
nothing calls this directly
no outgoing calls
no test coverage detected