michael@0: // Copyright (c) 2010 The Chromium Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: michael@0: #ifndef BASE_DIR_READER_FALLBACK_H_ michael@0: #define BASE_DIR_READER_FALLBACK_H_ michael@0: #pragma once michael@0: michael@0: namespace base { michael@0: michael@0: class DirReaderFallback { michael@0: public: michael@0: // Open a directory. If |IsValid| is true, then |Next| can be called to start michael@0: // the iteration at the beginning of the directory. michael@0: explicit DirReaderFallback(const char* directory_path) { } michael@0: // After construction, IsValid returns true iff the directory was michael@0: // successfully opened. michael@0: bool IsValid() const { return false; } michael@0: // Move to the next entry returning false if the iteration is complete. michael@0: bool Next() { return false; } michael@0: // Return the name of the current directory entry. michael@0: const char* name() { return 0;} michael@0: // Return the file descriptor which is being used. michael@0: int fd() const { return -1; } michael@0: // Returns true if this is a no-op fallback class (for testing). michael@0: static bool IsFallback() { return true; } michael@0: }; michael@0: michael@0: } // namespace base michael@0: michael@0: #endif // BASE_DIR_READER_FALLBACK_H_