1*6777b538SAndroid Build Coastguard Worker // Copyright 2012 The Chromium Authors 2*6777b538SAndroid Build Coastguard Worker // Use of this source code is governed by a BSD-style license that can be 3*6777b538SAndroid Build Coastguard Worker // found in the LICENSE file. 4*6777b538SAndroid Build Coastguard Worker 5*6777b538SAndroid Build Coastguard Worker #ifndef BASE_FILES_DIR_READER_FALLBACK_H_ 6*6777b538SAndroid Build Coastguard Worker #define BASE_FILES_DIR_READER_FALLBACK_H_ 7*6777b538SAndroid Build Coastguard Worker 8*6777b538SAndroid Build Coastguard Worker namespace base { 9*6777b538SAndroid Build Coastguard Worker 10*6777b538SAndroid Build Coastguard Worker class DirReaderFallback { 11*6777b538SAndroid Build Coastguard Worker public: 12*6777b538SAndroid Build Coastguard Worker // Open a directory. If |IsValid| is true, then |Next| can be called to start 13*6777b538SAndroid Build Coastguard Worker // the iteration at the beginning of the directory. DirReaderFallback(const char * directory_path)14*6777b538SAndroid Build Coastguard Worker explicit DirReaderFallback(const char* directory_path) {} 15*6777b538SAndroid Build Coastguard Worker 16*6777b538SAndroid Build Coastguard Worker // After construction, IsValid returns true iff the directory was 17*6777b538SAndroid Build Coastguard Worker // successfully opened. IsValid()18*6777b538SAndroid Build Coastguard Worker bool IsValid() const { return false; } 19*6777b538SAndroid Build Coastguard Worker 20*6777b538SAndroid Build Coastguard Worker // Move to the next entry returning false if the iteration is complete. Next()21*6777b538SAndroid Build Coastguard Worker bool Next() { return false; } 22*6777b538SAndroid Build Coastguard Worker 23*6777b538SAndroid Build Coastguard Worker // Return the name of the current directory entry. name()24*6777b538SAndroid Build Coastguard Worker const char* name() { return nullptr;} 25*6777b538SAndroid Build Coastguard Worker 26*6777b538SAndroid Build Coastguard Worker // Return the file descriptor which is being used. fd()27*6777b538SAndroid Build Coastguard Worker int fd() const { return -1; } 28*6777b538SAndroid Build Coastguard Worker 29*6777b538SAndroid Build Coastguard Worker // Returns true if this is a no-op fallback class (for testing). IsFallback()30*6777b538SAndroid Build Coastguard Worker static bool IsFallback() { return true; } 31*6777b538SAndroid Build Coastguard Worker }; 32*6777b538SAndroid Build Coastguard Worker 33*6777b538SAndroid Build Coastguard Worker } // namespace base 34*6777b538SAndroid Build Coastguard Worker 35*6777b538SAndroid Build Coastguard Worker #endif // BASE_FILES_DIR_READER_FALLBACK_H_ 36